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

Manage newsletter subscription in a modern ajax way #48

Merged
merged 7 commits into from Apr 10, 2020

Conversation

jf-viguier
Copy link
Contributor

This is more elegant and avoid full page reload, see PrestaShop/PrestaShop#17054

Newsletter subscription uses an old fashion "post to home page" form with several issues :

Notice : I've changed the version number to 2.5.2 to launch upgrade : I must register a new hook actionFrontControllerSetMedia to load my new js file.

@jf-viguier
Copy link
Contributor Author

I've made a new commit to replace ajaxRender by ajaxDie for Prestashop < 1.7.5 support

jf-viguier and others added 2 commits January 8, 2020 16:45
Co-Authored-By: GoT <PierreRambaud@users.noreply.github.com>
PierreRambaud
PierreRambaud previously approved these changes Jan 8, 2020
@jf-viguier
Copy link
Contributor Author

Any news from QA ?

1 similar comment
@jf-viguier
Copy link
Contributor Author

Any news from QA ?

Progi1984
Progi1984 previously approved these changes Feb 17, 2020
views/js/index.php Outdated Show resolved Hide resolved
views/js/index.php Outdated Show resolved Hide resolved
matks
matks previously approved these changes Feb 19, 2020
Progi1984
Progi1984 previously approved these changes Feb 19, 2020
@NeOMakinG
Copy link

Hey @jf-viguier

Please configure your IDE so it auto-add new line at the end of the file :)

@SD1982 SD1982 self-assigned this Feb 19, 2020
@jf-viguier
Copy link
Contributor Author

Hello @SD1982, I don't have this behavior. I'm in 1.7.6.2 and you ?
I've changed message position to match other ps behaviors like in account creation page.

@matks
Copy link
Contributor

matks commented Feb 20, 2020

@jf-viguier I tested your PR also (on 1.7.7.x). I have the same issue:
Capture d’écran 2020-02-20 à 11 12 00

I checked the AJAX query, the data.msg data returned by backend is empty
Capture d’écran 2020-02-20 à 11 13 09

{"value":"mathieu.fermentb@prestashop.comsss","msg":"","conditions":"Vous pouvez vous d\u00e9sinscrire \u00e0 tout moment. Vous trouverez pour cela nos informations de contact dans les conditions d'utilisation du site."}

EDIT: oh, same answer from @SD1982

@SD1982
Copy link

SD1982 commented Feb 20, 2020

Hello @jf-viguier This behavior appears when i test on version 1.7.7 but I just tested on version 1.7.6 like you and indeed it works correctly and as you can see the message is diplayed on top this time and without disabling javascript:

Version 1.7.6.x

#48 1 7 6 x after PR1

#48 1 7 6 x after PR2

so it probably does not come from your PR what do you think of that @matks , @NeOMakinG

@jf-viguier
Copy link
Contributor Author

@SD1982 please use a stable version ;-) You've certainly found a bug for 1.7.7 but I've no time to check this for now.
Certainly a bug in ajax request that doesn't have correct context of global vars stuff. @matks ? Other ajax messages works on 1.7.7 ?

@Robin-Fischer-PS
Copy link

I think we need @PrestaShop/prestashop-core-developers opinion on this ! If this PR works in 176 but not in 177, is this link to the PR or to the 177 version ?

Thanks

@jf-viguier
Copy link
Contributor Author

@Robin-Fischer-PS I've already answered this : it's linked to 177 version.
I just use old messages in ajax return array.
Tt's certainly a bug in ajax request that doesn't have correct context of global vars stuff.

@matks
Copy link
Contributor

matks commented Mar 11, 2020

@Robin-Fischer-PS I've already answered this : it's linked to 177 version.
I just use old messages in ajax return array.
Tt's certainly a bug in ajax request that doesn't have correct context of global vars stuff.

It does not matter. We are not going to accept a Pull Request that we know it will fail with 177 😉. What kind of professionnals would we be if we accept something that we know will fail with next release when it's scheduled for 1 or 2 months in the future ?

Until we know why it fails with 177 we cannot merge this PR.

It does not mean we will not merge this PR. It means we need more exploration.

@jf-viguier
Copy link
Contributor Author

Thanks @matks I understand. I just means that my pr is not the source of the bug. I guess that other ajax requests have this bug in 177 ?

@matks
Copy link
Contributor

matks commented Mar 12, 2020

@matks matks dismissed stale reviews from Progi1984 and themself via da17e14 March 12, 2020 10:51
@matks matks added waiting for QA and removed waiting for dev waiting for dev labels Mar 12, 2020
@matks
Copy link
Contributor

matks commented Mar 12, 2020

@jf-viguier Fixed with commit da17e14

This PR can now go through QA again, for both 176 and 177 checks 💪

@jf-viguier
Copy link
Contributor Author

Thanks @matks for the fix, you rocks

@SD1982
Copy link

SD1982 commented Apr 10, 2020

LGTM in 1.7.6.x and 1.7.7.x Thanks @jf-viguier

@Progi1984 Progi1984 merged commit 34c61d7 into PrestaShop:dev Apr 10, 2020
@Progi1984
Copy link
Contributor

Thanks @jf-viguier

@jf-viguier
Copy link
Contributor Author

@Progi1984 when this will pr be released ?

@jf-viguier
Copy link
Contributor Author

Newsletter subscription seems no more in ajax in hummingbird theme. Can someone confirm ?

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