Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client html side of user password change #152

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

WLsupport
Copy link

No description provided.


public function getSubClient(string $type, string $name = null): \Aimeos\Client\Html\Iface
{
// TODO: Implement getSubClient() method.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just copy the code from another file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added that

foreach( $this->getSubClients() as $subclient ) {
$html .= $subclient->setView( $view )->getBody( $uid );
}
$view->addressBody = $html;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace all occurrences of "address" by "account" everywhere

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed that

<?= $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>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All strings need to be translated

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +224 to +229
Validator::make([
'password' => $values['customer.newpassword'],
'password_confirmation' => $values['customer.confirmnewpassword']
], [
'password' => ['required', 'string', new Password, 'confirmed']
])->validate();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't use Laravel specific code in HTML clients. This won't work in other integrations.

Comment on lines +5 to +7
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Rules\Password;
use Laravel\Jetstream\Jetstream;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Laravel specific code is possible

@@ -0,0 +1,264 @@
<?php

namespace Aimeos\Client\Html\Account\Profile\Account;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change that to Aimeos\Client\Html\Account\Profile\Password instead?

* design.
*
* @param array List of sub-client names
* @since 2019.07
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update @since lines to 2021.10

Comment on lines +236 to +239
/** is the password realy new? */
if (!$isNew) {
$errors['isNew'] = "The given password is not new!";
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Bootstrap utitlity classes (d-block) please because they make theming harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants