Skip to content

Commit 0f6773d

Browse files
author
Yauhen_Lyskavets
committed
MC-16455: Admin user with permission for 1 store can manage categories
- Fix CR comments
1 parent f37537b commit 0f6773d

File tree

5 files changed

+13
-33
lines changed

5 files changed

+13
-33
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ protected function customizeCategoriesField(array $meta)
265265
'chipsEnabled' => true,
266266
'disableLabel' => true,
267267
'levelsVisibility' => '1',
268+
'disabled' => $fieldIsDisabled,
268269
'elementTmpl' => 'ui/grid/filters/elements/ui-select',
269270
'options' => $this->getCategoriesTree(),
270271
'disabled' => $fieldIsDisabled,

app/code/Magento/Ui/Component/Form/Element/Wysiwyg.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
declare(strict_types=1);
76

87
namespace Magento\Ui\Component\Form\Element;
98

@@ -52,9 +51,6 @@ public function __construct(
5251
array $config = []
5352
) {
5453
$wysiwygConfigData = isset($config['wysiwygConfigData']) ? $config['wysiwygConfigData'] : [];
55-
if (isset($config['disabled']) && $config['disabled'] === true) {
56-
$config['wysiwygConfigData']['settings']['readonly'] = 1;
57-
}
5854

5955
$this->form = $formFactory->create();
6056
$wysiwygId = $context->getNamespace() . '_' . $data['name'];

app/code/Magento/Ui/view/base/web/js/form/components/group.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ define([
3636
return this;
3737
},
3838

39-
/**
40-
* @inheritdoc
41-
*/
42-
initElement: function (elem) {
43-
this._super();
44-
45-
if (this.disabled) {
46-
try {
47-
elem.disabled(true);
48-
}
49-
catch (e) {
50-
51-
}
52-
}
53-
54-
return this;
55-
},
56-
5739
/**
5840
* Calls initObservable of parent class.
5941
* Defines observable properties of instance.

app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,8 @@ define([
568568
* Remove element from selected array
569569
*/
570570
removeSelected: function (value, data, event) {
571-
if (!this.disabled()) {
572-
event ? event.stopPropagation() : false;
573-
this.value.remove(value);
574-
}
571+
event ? event.stopPropagation() : false;
572+
this.value.remove(value);
575573
},
576574

577575
/**
@@ -663,9 +661,7 @@ define([
663661
* @returns {Object} Chainable
664662
*/
665663
toggleListVisible: function () {
666-
if (!this.disabled()) {
667-
this.listVisible(!this.listVisible());
668-
}
664+
this.listVisible(!this.listVisible());
669665

670666
return this;
671667
},

app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
.admin__field {
157157
margin-top: 8px;
158158
}
159-
}
159+
}
160160
}
161161
}
162162
&.composite-bundle {
@@ -307,7 +307,7 @@
307307
.admin__fieldset > & {
308308
margin-bottom: 3rem;
309309
position: relative;
310-
310+
311311
&.field-import_file {
312312
.input-file {
313313
margin-top: 6px;
@@ -361,6 +361,11 @@
361361
cursor: inherit;
362362
opacity: 1;
363363
outline: inherit;
364+
.admin__action-multiselect-wrap {
365+
.admin__action-multiselect {
366+
.__form-control-pattern__disabled();
367+
}
368+
}
364369
}
365370

366371
&._hidden {
@@ -664,7 +669,7 @@
664669
display: inline-block;
665670
}
666671
}
667-
672+
668673

669674
+ .admin__field:last-child {
670675
width: auto;
@@ -700,7 +705,7 @@
700705
width: 100%;
701706
}
702707
}
703-
& > .admin__field-label {
708+
& > .admin__field-label {
704709
text-align: left;
705710
}
706711

0 commit comments

Comments
 (0)