Skip to content

Commit 43e37e1

Browse files
author
Valeriy Nayda
authored
Merge pull request #28 from magento-engcom/mni/source-management-ui
Internal build https://bamboo.corp.magento.com/browse/M2-AT2096-13 Acceptance Tests plan is green.
2 parents 2bc3bb0 + 98f303b commit 43e37e1

File tree

288 files changed

+10455
-2406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+10455
-2406
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ atlassian*
6666
!/vendor/.htaccess
6767
/generated/*
6868
!/generated/.htaccess
69+
.DS_Store

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,22 @@ env:
2222
- MAGENTO_HOST_NAME="magento2.travis"
2323
matrix:
2424
- TEST_SUITE=unit
25+
- TEST_SUITE=static
26+
- TEST_SUITE=js GRUNT_COMMAND=spec
27+
- TEST_SUITE=js GRUNT_COMMAND=static
2528
- TEST_SUITE=integration INTEGRATION_INDEX=1
2629
- TEST_SUITE=integration INTEGRATION_INDEX=2
2730
- TEST_SUITE=integration INTEGRATION_INDEX=3
28-
- TEST_SUITE=static
29-
- TEST_SUITE=js
3031
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
3132
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
3233
matrix:
3334
exclude:
3435
- php: 7.0
3536
env: TEST_SUITE=static
3637
- php: 7.0
37-
env: TEST_SUITE=js
38+
env: TEST_SUITE=js GRUNT_COMMAND=spec
39+
- php: 7.0
40+
env: TEST_SUITE=js GRUNT_COMMAND=static
3841
- php: 7.0
3942
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
4043
- php: 7.0
@@ -49,4 +52,11 @@ cache:
4952
before_install: ./dev/travis/before_install.sh
5053
install: composer install --no-interaction --prefer-dist
5154
before_script: ./dev/travis/before_script.sh
52-
script: ./dev/travis/script.sh
55+
script:
56+
# Set arguments for variants of phpunit based tests; '|| true' prevents failing script when leading test fails
57+
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
58+
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true
59+
60+
# The scripts for grunt/phpunit type tests
61+
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
62+
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ If you are a new GitHub user, we recommend that you create your own [free github
2929
3. Create and test your work.
3030
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#pull_request).
3131
5. Once your contribution is received, Magento 2 development team will review the contribution and collaborate with you as needed to improve the quality of the contribution.
32+
33+
## Code of Conduct
34+
35+
Please note that this project is released with a Contributor Code of Conduct. We expect you to agree to its terms when participating in this project.
36+
The full text is available in the repository [Wiki](https://github.com/magento/magento2/wiki/Magento-Code-of-Conduct).
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Ui\Component\Control;
7+
8+
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
9+
use Magento\Ui\Component\Control\Container;
10+
11+
/**
12+
* @api
13+
*/
14+
class SaveSplitButton implements ButtonProviderInterface
15+
{
16+
/**
17+
* @var string
18+
*/
19+
private $saveTarget;
20+
21+
/**
22+
* @param string $saveTarget
23+
*/
24+
public function __construct($saveTarget)
25+
{
26+
$this->saveTarget = $saveTarget;
27+
}
28+
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
public function getButtonData()
33+
{
34+
return [
35+
'label' => __('Save &amp; Continue'),
36+
'class' => 'save primary',
37+
'data_attribute' => [
38+
'mage-init' => [
39+
'buttonAdapter' => [
40+
'actions' => [
41+
[
42+
'targetName' => $this->saveTarget,
43+
'actionName' => 'save',
44+
'params' => [
45+
// first param is redirect flag
46+
false,
47+
]
48+
]
49+
]
50+
]
51+
]
52+
],
53+
'class_name' => Container::SPLIT_BUTTON,
54+
'options' => $this->getOptions(),
55+
'sort_order' => 40,
56+
];
57+
}
58+
59+
/**
60+
* @return array
61+
*/
62+
private function getOptions()
63+
{
64+
$options = [
65+
[
66+
'label' => __('Save &amp; Close'),
67+
'data_attribute' => [
68+
'mage-init' => [
69+
'buttonAdapter' => [
70+
'actions' => [
71+
[
72+
'targetName' => $this->saveTarget,
73+
'actionName' => 'save',
74+
'params' => [
75+
// first param is redirect flag
76+
true,
77+
],
78+
],
79+
],
80+
],
81+
],
82+
],
83+
'sort_order' => 10,
84+
],
85+
[
86+
'label' => __('Save &amp; New'),
87+
'data_attribute' => [
88+
'mage-init' => [
89+
'buttonAdapter' => [
90+
'actions' => [
91+
[
92+
'targetName' => $this->saveTarget,
93+
'actionName' => 'save',
94+
'params' => [
95+
// first param is redirect flag, second is data that will be added to post
96+
// request
97+
true,
98+
[
99+
'redirect_to_new' => 1,
100+
],
101+
],
102+
],
103+
],
104+
],
105+
],
106+
],
107+
'sort_order' => 20,
108+
],
109+
];
110+
return $options;
111+
}
112+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Ui\Component\Listing\Column;
7+
8+
use Magento\Framework\UrlInterface;
9+
use Magento\Framework\View\Element\UiComponent\ContextInterface;
10+
use Magento\Framework\View\Element\UiComponentFactory;
11+
use Magento\Ui\Component\Listing\Columns\Column;
12+
13+
/**
14+
* @api
15+
*/
16+
class EditAction extends Column
17+
{
18+
/**
19+
* @var UrlInterface
20+
*/
21+
private $urlBuilder;
22+
23+
/**
24+
* @param ContextInterface $context
25+
* @param UiComponentFactory $uiComponentFactory
26+
* @param UrlInterface $urlBuilder
27+
* @param array $components
28+
* @param array $data
29+
*/
30+
public function __construct(
31+
ContextInterface $context,
32+
UiComponentFactory $uiComponentFactory,
33+
UrlInterface $urlBuilder,
34+
array $components = [],
35+
array $data = []
36+
) {
37+
$this->urlBuilder = $urlBuilder;
38+
parent::__construct($context, $uiComponentFactory, $components, $data);
39+
}
40+
41+
/**
42+
* @param array $dataSource
43+
* @return array
44+
*/
45+
public function prepareDataSource(array $dataSource)
46+
{
47+
if (isset($dataSource['data']['items'])) {
48+
foreach ($dataSource['data']['items'] as &$item) {
49+
if (isset($item[$item['id_field_name']])) {
50+
$editUrlPath = $this->getData('config/editUrlPath') ?: '#';
51+
$item[$this->getData('name')] = [
52+
'edit' => [
53+
'href' => $this->urlBuilder->getUrl($editUrlPath, [
54+
$item['id_field_name'] => $item[$item['id_field_name']],
55+
]),
56+
'label' => __('Edit')
57+
]
58+
];
59+
unset($item);
60+
}
61+
}
62+
}
63+
return $dataSource;
64+
}
65+
}

app/code/Magento/Backend/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"magento/module-translation": "100.2.*",
1919
"magento/module-require-js": "100.2.*",
2020
"magento/module-config": "100.2.*",
21+
"magento/module-ui": "100.2.*",
2122
"magento/framework": "100.2.*"
2223
},
2324
"suggest": {

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
46-
autocomplete="off"
46+
autocomplete="new-password"
4747
/>
4848
</div>
4949
</div>

app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<fieldset class="admin__fieldset password-box-container">
7474
<div class="admin__field field _required">
7575
<label for="password" class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('User Password')?></span></label>
76-
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="off"></div>
76+
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="new-password"></div>
7777
</div>
7878

7979
<div class="admin__field field maintenance-checkbox-container">
@@ -119,7 +119,7 @@
119119
<span><?php /* @escapeNotVerified */ echo __('FTP Password') ?></span>
120120
</label>
121121
<div class="admin__field-control">
122-
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="off">
122+
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="new-password">
123123
</div>
124124
</div>
125125
<div class="admin__field field">

app/code/Magento/Braintree/Block/Paypal/Button.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*/
66
namespace Magento\Braintree\Block\Paypal;
77

8-
use Magento\Checkout\Model\Session;
8+
use Magento\Braintree\Gateway\Config\PayPal\Config;
9+
use Magento\Braintree\Model\Ui\ConfigProvider;
910
use Magento\Catalog\Block\ShortcutInterface;
10-
use Magento\Framework\View\Element\Template;
11+
use Magento\Checkout\Model\Session;
1112
use Magento\Framework\Locale\ResolverInterface;
12-
use Magento\Braintree\Model\Ui\ConfigProvider;
13+
use Magento\Framework\View\Element\Template;
1314
use Magento\Framework\View\Element\Template\Context;
14-
use Magento\Braintree\Gateway\Config\PayPal\Config;
1515
use Magento\Payment\Model\MethodInterface;
1616

1717
/**
@@ -110,7 +110,7 @@ public function getContainerId()
110110
*/
111111
public function getLocale()
112112
{
113-
return strtolower($this->localeResolver->getLocale());
113+
return $this->localeResolver->getLocale();
114114
}
115115

116116
/**
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Braintree\Model;
7+
8+
use Magento\Framework\Locale\ResolverInterface;
9+
use Magento\Braintree\Gateway\Config\PayPal\Config;
10+
11+
class LocaleResolver implements ResolverInterface
12+
{
13+
/**
14+
* @var ResolverInterface
15+
*/
16+
private $resolver;
17+
18+
/**
19+
* @var Config
20+
*/
21+
private $config;
22+
23+
/**
24+
* @param ResolverInterface $resolver
25+
* @param Config $config
26+
*/
27+
public function __construct(ResolverInterface $resolver, Config $config)
28+
{
29+
$this->resolver = $resolver;
30+
$this->config = $config;
31+
}
32+
33+
/**
34+
* @inheritdoc
35+
*/
36+
public function getDefaultLocalePath()
37+
{
38+
return $this->resolver->getDefaultLocalePath();
39+
}
40+
41+
/**
42+
* @inheritdoc
43+
*/
44+
public function setDefaultLocale($locale)
45+
{
46+
return $this->resolver->setDefaultLocale($locale);
47+
}
48+
49+
/**
50+
* @inheritdoc
51+
*/
52+
public function getDefaultLocale()
53+
{
54+
return $this->resolver->getDefaultLocale();
55+
}
56+
57+
/**
58+
* @inheritdoc
59+
*/
60+
public function setLocale($locale = null)
61+
{
62+
return $this->resolver->setLocale($locale);
63+
}
64+
65+
/**
66+
* Gets store's locale or the `en_US` locale if store's locale does not supported by PayPal.
67+
*
68+
* @return string
69+
*/
70+
public function getLocale()
71+
{
72+
$locale = $this->resolver->getLocale();
73+
$allowedLocales = $this->config->getValue('supported_locales');
74+
75+
return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US';
76+
}
77+
78+
/**
79+
* @inheritdoc
80+
*/
81+
public function emulate($scopeId)
82+
{
83+
return $this->resolver->emulate($scopeId);
84+
}
85+
86+
/**
87+
* @inheritdoc
88+
*/
89+
public function revert()
90+
{
91+
return $this->resolver->revert();
92+
}
93+
}

app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getConfig()
5454
'title' => $this->config->getTitle(),
5555
'isAllowShippingAddressOverride' => $this->config->isAllowToEditShippingAddress(),
5656
'merchantName' => $this->config->getMerchantName(),
57-
'locale' => strtolower($this->resolver->getLocale()),
57+
'locale' => $this->resolver->getLocale(),
5858
'paymentAcceptanceMarkSrc' =>
5959
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
6060
'vaultCode' => self::PAYPAL_VAULT_CODE,

0 commit comments

Comments
 (0)