Skip to content

Commit 00806b2

Browse files
committed
MAGETWO-89383: [UI Component] URL Input: External Link
1 parent 9dbabf9 commit 00806b2

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

app/code/Magento/Ui/Model/UrlInput/LinksProvider.php renamed to app/code/Magento/Ui/Model/UrlInput/LinksConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Returns information about allowed links
1313
*/
14-
class LinksProvider implements ConfigInterface
14+
class LinksConfigProvider implements ConfigInterface
1515
{
1616
/**
1717
* @var array

app/code/Magento/Ui/Model/UrlInput/DefaultLink.php renamed to app/code/Magento/Ui/Model/UrlInput/Url.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
/**
1111
* Returns configuration for default Url Input type
1212
*/
13-
class DefaultLink implements ConfigInterface
13+
class Url implements ConfigInterface
1414
{
15-
1615
/**
1716
* {@inheritdoc}
1817
*/

app/code/Magento/Ui/etc/adminhtml/di.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
</argument>
4545
</arguments>
4646
</type>
47-
<type name="Magento\Ui\Model\UrlInput\LinksProvider">
47+
<type name="Magento\Ui\Model\UrlInput\LinksConfigProvider">
4848
<arguments>
4949
<argument name="linksConfiguration" xsi:type="array">
50-
<item name="default" xsi:type="string">Magento\Ui\Model\UrlInput\DefaultLink</item>
50+
<item name="default" xsi:type="string">Magento\Ui\Model\UrlInput\Url</item>
5151
</argument>
5252
</arguments>
5353
</type>

app/code/Magento/Ui/view/base/web/js/form/element/url-input.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ define([
2525
isDisplayAdditionalSettings: true,
2626
settingValue: false,
2727
settingLabel: $t('Open in new tab'),
28-
29-
//observable object(without functional call)
3028
tracks: {
3129
linkedElement: true
3230
},
@@ -49,12 +47,8 @@ define([
4947
}
5048
},
5149

52-
/**
53-
*
54-
* @inheritdoc
55-
*/
50+
/** @inheritdoc */
5651
initialize: function () {
57-
5852
this._super()
5953
.setOptions();
6054

@@ -76,6 +70,8 @@ define([
7670

7771
/**
7872
* Adds link types array with default settings
73+
*
74+
* @return {Object}
7975
*/
8076
processLinkTypes: function () {
8177
var processedLinkTypes = {},
@@ -98,7 +94,7 @@ define([
9894
/**
9995
* Set options to select based on link types configuration
10096
*
101-
* @return {exports}
97+
* @return {Object}
10298
*/
10399
setOptions: function () {
104100
var result = [];
@@ -121,9 +117,7 @@ define([
121117
return this;
122118
},
123119

124-
/**
125-
* @inheritdoc
126-
*/
120+
/** @inheritdoc */
127121
setPreview: function (visible) {
128122
this.linkedElement().visible(visible);
129123
},
@@ -132,15 +126,12 @@ define([
132126
* Initializes observable properties of instance
133127
*
134128
* @param {Boolean} disabled
135-
* @returns void.
136129
*/
137130
hideLinkedElement: function (disabled) {
138131
this.linkedElement().disabled(disabled);
139132
},
140133

141-
/**
142-
* @{inheritDoc}
143-
*/
134+
/** @inheritdoc */
144135
destroy: function () {
145136
_.each(this.linkedElementInstances, function (value) {
146137
value().destroy();

app/code/Magento/Ui/view/base/web/templates/form/element/url-input.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!--render select with link types-->
88
<div class="admin__field url-input-container"
99
visible="visible"
10+
css="$data.additionalClasses"
1011
attr="'data-index': index">
1112
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
1213
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>

app/design/adminhtml/Magento/backend/web/css/source/components/_url_input.less

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
.url-input-element-linked-element {
2727
float: left;
2828
margin-left: 1.5em;
29-
max-width: calc(79%);
30-
min-width: calc(79%);
29+
width: calc(~'100% - 9em');
3130
}
3231
}
33-
34-

0 commit comments

Comments
 (0)