Skip to content

Commit 942d806

Browse files
ENGCOM-6414: [Ui] Adding admin class for password input type. #25918
2 parents 7ad79f7 + 94717d7 commit 942d806

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

app/code/Magento/Backend/Block/System/Account/Edit/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(
6868
}
6969

7070
/**
71-
* {@inheritdoc}
71+
* @inheritdoc
7272
*/
7373
protected function _prepareForm()
7474
{
@@ -114,7 +114,7 @@ protected function _prepareForm()
114114
'name' => 'password',
115115
'label' => __('New Password'),
116116
'title' => __('New Password'),
117-
'class' => 'validate-admin-password admin__control-text'
117+
'class' => 'validate-admin-password'
118118
]
119119
);
120120

@@ -124,7 +124,7 @@ protected function _prepareForm()
124124
[
125125
'name' => 'password_confirmation',
126126
'label' => __('Password Confirmation'),
127-
'class' => 'validate-cpassword admin__control-text'
127+
'class' => 'validate-cpassword'
128128
]
129129
);
130130

@@ -152,7 +152,7 @@ protected function _prepareForm()
152152
'label' => __('Your Password'),
153153
'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD,
154154
'title' => __('Your Password'),
155-
'class' => 'validate-current-password required-entry admin__control-text',
155+
'class' => 'validate-current-password required-entry',
156156
'required' => true
157157
]
158158
);

app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected function _addGeneralFieldset($form, $integrationData)
179179
'label' => __('Your Password'),
180180
'id' => self::DATA_CONSUMER_PASSWORD,
181181
'title' => __('Your Password'),
182-
'class' => 'input-text validate-current-password required-entry',
182+
'class' => 'validate-current-password required-entry',
183183
'required' => true
184184
]
185185
);

app/code/Magento/User/Block/Role/Tab/Info.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
namespace Magento\User\Block\Role\Tab;
77

88
/**
9-
* implementing now
9+
* Info
10+
*
11+
* User role tab info
1012
*
1113
* @SuppressWarnings(PHPMD.DepthOfInheritance)
1214
*/
@@ -18,6 +20,8 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magent
1820
const IDENTITY_VERIFICATION_PASSWORD_FIELD = 'current_password';
1921

2022
/**
23+
* Get tab label
24+
*
2125
* @return \Magento\Framework\Phrase
2226
*/
2327
public function getTabLabel()
@@ -26,6 +30,8 @@ public function getTabLabel()
2630
}
2731

2832
/**
33+
* Get tab title
34+
*
2935
* @return string
3036
*/
3137
public function getTabTitle()
@@ -34,6 +40,8 @@ public function getTabTitle()
3440
}
3541

3642
/**
43+
* Can show tab
44+
*
3745
* @return bool
3846
*/
3947
public function canShowTab()
@@ -42,6 +50,8 @@ public function canShowTab()
4250
}
4351

4452
/**
53+
* Is tab hidden
54+
*
4555
* @return bool
4656
*/
4757
public function isHidden()
@@ -50,6 +60,8 @@ public function isHidden()
5060
}
5161

5262
/**
63+
* Before html rendering
64+
*
5365
* @return $this
5466
*/
5567
public function _beforeToHtml()
@@ -60,6 +72,8 @@ public function _beforeToHtml()
6072
}
6173

6274
/**
75+
* Form initializatiion
76+
*
6377
* @return void
6478
*/
6579
protected function _initForm()
@@ -99,7 +113,7 @@ protected function _initForm()
99113
'label' => __('Your Password'),
100114
'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD,
101115
'title' => __('Your Password'),
102-
'class' => 'input-text validate-current-password required-entry',
116+
'class' => 'validate-current-password required-entry',
103117
'required' => true
104118
]
105119
);

app/code/Magento/User/Block/User/Edit/Tab/Main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function _prepareForm()
184184
'label' => __('Your Password'),
185185
'id' => self::CURRENT_USER_PASSWORD_FIELD,
186186
'title' => __('Your Password'),
187-
'class' => 'input-text validate-current-password required-entry',
187+
'class' => 'validate-current-password required-entry',
188188
'required' => true
189189
]
190190
);

lib/internal/Magento/Framework/Data/Form/Element/Password.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
use Magento\Framework\Escaper;
1515

16+
/**
17+
* Class Password
18+
*
19+
* Password input type
20+
*/
1621
class Password extends AbstractElement
1722
{
1823
/**
@@ -33,11 +38,14 @@ public function __construct(
3338
}
3439

3540
/**
41+
* Get field html
42+
*
3643
* @return mixed
3744
*/
3845
public function getHtml()
3946
{
40-
$this->addClass('input-text');
47+
$this->addClass('input-text admin__control-text');
48+
4149
return parent::getHtml();
4250
}
4351
}

lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/PasswordTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function testGetHtml()
5353
{
5454
$html = $this->_model->getHtml();
5555
$this->assertContains('type="password"', $html);
56-
$this->assertTrue(preg_match('/class=\".*input-text.*\"/i', $html) > 0);
56+
$this->assertTrue(preg_match('/class=\"* input-text admin__control-text.*\"/i', $html) > 0);
5757
}
5858
}

0 commit comments

Comments
 (0)