Skip to content

Commit 8238fdd

Browse files
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-91220' into team3-delivery
2 parents 1c8579a + d056359 commit 8238fdd

File tree

2 files changed

+42
-0
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/element
  • dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element

2 files changed

+42
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ define([
5555
linkSettingsArray.name = baseLinkType.namePrefix + linkName;
5656
linkSettingsArray.dataScope = baseLinkType.dataScopePrefix + linkName;
5757
linkSettingsArray.type = linkName;
58+
linkSettingsArray.disabled = config.disabled;
59+
linkSettingsArray.visible = config.visible;
5860
processedLinkTypes[linkName] = {};
5961
_.extend(processedLinkTypes[linkName], baseLinkType, linkSettingsArray);
6062
});

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/url-input.test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,45 @@ define([
7272
});
7373
});
7474

75+
describe('Parent config properties are propagated', function () {
76+
it('sets the disabled property on the child element', function () {
77+
var params = {
78+
dataScope: 'urlInput',
79+
disabled: true,
80+
urlTypes: {
81+
url: {
82+
label: 'Test label',
83+
component: 'Magento_Ui/js/form/element/abstract',
84+
template: 'ui/form/element/input',
85+
sortOrder: 40
86+
}
87+
}
88+
};
89+
90+
component = new UrlInput(params);
91+
expect(component.disabled()).toBe(true);
92+
expect(component.urlTypes.url.disabled).toBe(true);
93+
});
94+
95+
it('sets the visible property on the child element', function () {
96+
var params = {
97+
dataScope: 'urlInput',
98+
visible: false,
99+
urlTypes: {
100+
url: {
101+
label: 'Test label',
102+
component: 'Magento_Ui/js/form/element/abstract',
103+
template: 'ui/form/element/input',
104+
sortOrder: 40
105+
}
106+
}
107+
};
108+
109+
component = new UrlInput(params);
110+
expect(component.visible()).toBe(false);
111+
expect(component.urlTypes.url.visible).toBe(false);
112+
});
113+
});
114+
75115
});
76116
});

0 commit comments

Comments
 (0)