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

Allows profile to override the avatar of employee #20430

Merged
merged 5 commits into from Nov 5, 2020

Conversation

Progi1984
Copy link
Contributor

@Progi1984 Progi1984 commented Aug 3, 2020

Questions Answers
Branch? develop
Description? Allows profile to override the avatar of employee
Type? improvement
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #18653
How to test? 0. Build assets
1. Install PrestaShop
2. Add an avatar to group Translator
3. Add an employee "A" with an avatar
4. Add an employee "B" with an avatar and add it to Translator
5. Add an employee "C" without an avatar and add it to Translator
6. Add an employee "D" without an avatar
7. Add an employee "E" without an avatar with Gravatar
8. Add an employee "F" without an avatar with Gravatar and add it to Translator
9. Add an employee "G" with an avatar with Gravatar and add it to Translator
10. Connect as A
11. ✔️ The avatar of the employee A is displayed
12. Connect as B
13. ✔️ The avatar of the group Translator is displayed
14. Connect as C
15. ✔️ The avatar of the group Translator is displayed
16. Connect as D
17. ✔️ The avatar "White man on black background" is displayed
18. Connect as E
19. ✔️ The gravatar is displayed
20. Connect as F
21. ✔️ The avatar of the group Translator is displayed
22. Connect as superadmin
23. Install module ps_qualityassurance
23 bis. Give permissions "View" on module ps_qualityassurance for the group "Translator"
24. Register a new hook with actionOverrideEmployeeImage
25. Use this code $params['imageUrl'] = 'https://avatars.dicebear.com/api/male/' .urlencode($params['employee']->email).'.svg';
26. Connect as A, B, C, D, E, F, G
27. And the hook will override the avatar or gravatar :
image

📓 BC Break

  • The final class PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataHandler\ProfileFormDataHandler has a new second parameter : a parameter of type PrestaShop\PrestaShop\Core\Image\Uploader\ImageUploaderInterface

This change is Reviewable

@Progi1984 Progi1984 requested a review from a team as a code owner August 3, 2020 10:21
@prestonBot prestonBot added develop Branch Improvement Type: Improvement Waiting for wording Status: action required, waiting for wording labels Aug 3, 2020
@Progi1984 Progi1984 added this to the 1.7.8.0 milestone Aug 3, 2020
@LouiseBonnard LouiseBonnard added Wording ✔️ Status: check done, wording approved and removed Waiting for wording Status: action required, waiting for wording labels Aug 4, 2020
@prestonBot prestonBot added the Waiting for wording Status: action required, waiting for wording label Aug 4, 2020
@LouiseBonnard LouiseBonnard removed the Waiting for wording Status: action required, waiting for wording label Aug 4, 2020
matks
matks previously approved these changes Sep 15, 2020
Copy link
Contributor

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

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

Mostly improvement comments ^^
Seems like a great feature otherwise!

PierreRambaud
PierreRambaud previously approved these changes Oct 5, 2020
@Progi1984 Progi1984 added the Waiting for QA Status: action required, waiting for test feedback label Oct 5, 2020
@SD1982 SD1982 self-assigned this Oct 7, 2020
@SD1982
Copy link
Contributor

SD1982 commented Nov 3, 2020

Hi @Progi1984 All the steps from 1 to 21 are OK but after the step 21 it seems that the hook not override correctly and i still have the "default' avatars or the translator avatar created in the previous steps.

The QA module is installed and configured with the script given in the step 25 and I still have the translator avatar:
image

@SD1982 SD1982 added the Waiting for author Status: action required, waiting for author feedback label Nov 3, 2020
@prestonBot prestonBot added Waiting for wording Status: action required, waiting for wording and removed Wording ✔️ Status: check done, wording approved labels Nov 4, 2020
@Progi1984 Progi1984 added Wording ✔️ Status: check done, wording approved and removed Waiting for wording Status: action required, waiting for wording labels Nov 4, 2020
@SD1982
Copy link
Contributor

SD1982 commented Nov 5, 2020

LGTM The employee avatar is correctly overrided by the actionOverrideEmployeeImage hook
image

Thanks @Progi1984 !!

@SD1982 SD1982 added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback Waiting for author Status: action required, waiting for author feedback labels Nov 5, 2020
@prestashop-issue-bot
Copy link

QA OK without required approvals !? :trollface:

@Progi1984 Progi1984 merged commit 1496f73 into PrestaShop:develop Nov 5, 2020
@Progi1984 Progi1984 deleted the issue18653 branch November 5, 2020 10:19
@Progi1984
Copy link
Contributor Author

Thanks @SD1982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Type: Introduces a backwards-incompatible break develop Branch Improvement Type: Improvement QA ✔️ Status: check done, code approved Wording ✔️ Status: check done, wording approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to better handle avatars
8 participants