-
Notifications
You must be signed in to change notification settings - Fork 119
Refactor emailalerts and psgdpr modules #903
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
Merged
tblivet
merged 16 commits into
PrestaShop:develop
from
tblivet:feat/mail-alert-and-config
Jan 21, 2026
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
80178ad
feat: refactor emailalerts
tblivet 91b1abf
feat: refactor gdpr
tblivet 0093c94
chore: clean
tblivet e3ca4b7
feat: add styles
tblivet c664377
feat: refactor
tblivet 3bf1d91
chore: naming
tblivet da58c6f
feat: use capture to make cleaner
tblivet 40b5cbf
fix: condition
tblivet f084d11
feat: add unique id
tblivet 044d5dc
fix: styles
tblivet 6acc81d
feat: validator
tblivet dad9bd3
feat: remove example
tblivet e2fbda8
chore: review
tblivet 7fc2b05
chore: lint
tblivet fe29de9
chore: lint
tblivet 35e2c69
chore: lint
tblivet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /* mailalert.js */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,12 +16,30 @@ | |||||||||||||||||||||||||
| * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||||||||||||||||||||||||||
| * International Registered Trademark & Property of PrestaShop SA | ||||||||||||||||||||||||||
| *} | ||||||||||||||||||||||||||
| {extends file='modules/psgdpr/views/templates/hook/displayGDPRConsent.tpl'} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| {block name='gdpr_checkbox'} | ||||||||||||||||||||||||||
| <div id="gdpr_consent" class="mt-2 gdpr_module_{$psgdpr_id_module|escape:'htmlall':'UTF-8'}"> | ||||||||||||||||||||||||||
| {capture name='gdprData'}{strip}{ldelim} | ||||||||||||||||||||||||||
| "moduleId": "{$psgdpr_id_module|escape:'htmlall':'UTF-8'}", | ||||||||||||||||||||||||||
| "frontController": "{$psgdpr_front_controller|escape:'htmlall':'UTF-8'}", | ||||||||||||||||||||||||||
| "idCustomer": "{$psgdpr_id_customer|escape:'htmlall':'UTF-8'}", | ||||||||||||||||||||||||||
| "customerToken": "{$psgdpr_customer_token|escape:'htmlall':'UTF-8'}", | ||||||||||||||||||||||||||
| "idGuest": "{$psgdpr_id_guest|escape:'htmlall':'UTF-8'}", | ||||||||||||||||||||||||||
| "guestToken": "{$psgdpr_guest_token|escape:'htmlall':'UTF-8'}" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| "moduleId": "{$psgdpr_id_module|escape:'htmlall':'UTF-8'}", | |
| "frontController": "{$psgdpr_front_controller|escape:'htmlall':'UTF-8'}", | |
| "idCustomer": "{$psgdpr_id_customer|escape:'htmlall':'UTF-8'}", | |
| "customerToken": "{$psgdpr_customer_token|escape:'htmlall':'UTF-8'}", | |
| "idGuest": "{$psgdpr_id_guest|escape:'htmlall':'UTF-8'}", | |
| "guestToken": "{$psgdpr_guest_token|escape:'htmlall':'UTF-8'}" | |
| "id_module": "{$psgdpr_id_module|escape:'htmlall':'UTF-8'}", | |
| "front_controller": "{$psgdpr_front_controller|escape:'htmlall':'UTF-8'}", | |
| "id_customer": "{$psgdpr_id_customer|escape:'htmlall':'UTF-8'}", | |
| "customer_token": "{$psgdpr_customer_token|escape:'htmlall':'UTF-8'}", | |
| "id_guest": "{$psgdpr_id_guest|escape:'htmlall':'UTF-8'}", | |
| "guest_token": "{$psgdpr_guest_token|escape:'htmlall':'UTF-8'}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| /** | ||
| * Parse JSON data from data-ps-data attribute | ||
| * | ||
| * @example | ||
| * // HTML: <button data-ps-data='{"id": "123", "name": "Product"}'> | ||
| * const data = parseData<{id: string, name: string}>(button); | ||
| * // Returns: { id: "123", name: "Product" } | ||
| * | ||
| * @param element - The HTML element containing data-ps-data attribute | ||
| * @returns Parsed data object or null if parsing fails | ||
| */ | ||
| const parseData = <T>(element: HTMLElement): T | null => { | ||
| const {psData} = element.dataset; | ||
|
|
||
| if (!psData) return null; | ||
|
|
||
| try { | ||
| return JSON.parse(psData) as T; | ||
| } catch { | ||
| console.error('[parseData] Failed to parse data-ps-data:', psData); | ||
| return null; | ||
| } | ||
| }; | ||
|
|
||
| export default parseData; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.