client html side of user password change#152
client html side of user password change#152WLsupport wants to merge 5 commits intoaimeos:masterfrom
Conversation
|
|
||
| public function getSubClient(string $type, string $name = null): \Aimeos\Client\Html\Iface | ||
| { | ||
| // TODO: Implement getSubClient() method. |
There was a problem hiding this comment.
Just copy the code from another file
| foreach( $this->getSubClients() as $subclient ) { | ||
| $html .= $subclient->setView( $view )->getBody( $uid ); | ||
| } | ||
| $view->addressBody = $html; |
There was a problem hiding this comment.
Replace all occurrences of "address" by "account" everywhere
There was a problem hiding this comment.
replaced every occurance of "address"
| <form class="container-fluid" method="POST" action="<?= $enc->attr( $this->link( 'client/html/account/profile/url' ) ) ?>"> | ||
| <?= $this->csrf()->formfield() ?> | ||
| <?php if ( $this->get('passwordChanged', '') === 'true' ) : ?> | ||
| <div class="row d-flex justify-content-center"> |
There was a problem hiding this comment.
Utility CSS classes are handy but a bad idea if different themes have to cope with them. Please add the necessary styles to the CSS file.
| <?= $this->csrf()->formfield() ?> | ||
| <?php if ( $this->get('passwordChanged', '') === 'true' ) : ?> | ||
| <div class="row d-flex justify-content-center"> | ||
| <h2 class="text-success">Password changed successfull!</h2> |
There was a problem hiding this comment.
All strings need to be translated
| Validator::make([ | ||
| 'password' => $values['customer.newpassword'], | ||
| 'password_confirmation' => $values['customer.confirmnewpassword'] | ||
| ], [ | ||
| 'password' => ['required', 'string', new Password, 'confirmed'] | ||
| ])->validate(); |
There was a problem hiding this comment.
You can't use Laravel specific code in HTML clients. This won't work in other integrations.
| use Illuminate\Support\Facades\Validator; | ||
| use Laravel\Fortify\Rules\Password; | ||
| use Laravel\Jetstream\Jetstream; |
There was a problem hiding this comment.
No Laravel specific code is possible
| @@ -0,0 +1,264 @@ | |||
| <?php | |||
|
|
|||
| namespace Aimeos\Client\Html\Account\Profile\Account; | |||
There was a problem hiding this comment.
Can you change that to Aimeos\Client\Html\Account\Profile\Password instead?
| * design. | ||
| * | ||
| * @param array List of sub-client names | ||
| * @since 2019.07 |
There was a problem hiding this comment.
Please update @since lines to 2021.10
| /** is the password realy new? */ | ||
| if (!$isNew) { | ||
| $errors['isNew'] = "The given password is not new!"; | ||
| } |
There was a problem hiding this comment.
If a password isn't new doesn't matter for the customer so we could remove that
| placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>" | ||
| > | ||
| <?php if( isset($passwordErrors['oldPassword']) ) : ?> | ||
| <span class="invalid-feedback d-block" role="alert"> |
There was a problem hiding this comment.
No Bootstrap utitlity classes (d-block) please because they make theming harder.
No description provided.