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

[MIG] website_mass_mailing_name: Migration to 12.0 #385

Merged
merged 8 commits into from
Jun 17, 2019

Conversation

victormmtorres
Copy link

No description provided.

@pedrobaeza pedrobaeza added this to the 12.0 milestone May 21, 2019
@OCA-git-bot OCA-git-bot mentioned this pull request May 21, 2019
24 tasks
@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from 074e240 to e05b836 Compare May 22, 2019 08:51
@victormmtorres
Copy link
Author

Once test fixed I'll set to review

@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from e05b836 to 70e9167 Compare May 28, 2019 15:30
@victormmtorres victormmtorres marked this pull request as ready for review May 28, 2019 15:31
@victormmtorres
Copy link
Author

cc @Tecnativa

@pedrobaeza pedrobaeza requested a review from Tardo May 28, 2019 15:31
@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from 70e9167 to 3dde16b Compare May 28, 2019 15:32
@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from 3dde16b to b6063d5 Compare May 29, 2019 08:43
@victormmtorres
Copy link
Author

Changes done @yajo

@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from b6063d5 to be463f8 Compare May 29, 2019 10:04
@victormmtorres
Copy link
Author

@yajo Changes done

Copy link
Member

@Tardo Tardo left a comment

Choose a reason for hiding this comment

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

LGTM, tested on runbot

@pedrobaeza
Copy link
Member

When someone approves a PR, but put comments, they are only informative ones, that can be changed if you want, but not blocking. I understand those 2 as this type, for knowing more JS tricks, accelerators, and so.

I'm seeing a warning in runbot, but logs are not accessible. I have launched a rebuild. Please check when finished, and if you want, make the proposed improvements, that are not blocking.

@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from be463f8 to 3901215 Compare June 3, 2019 15:23
@victormmtorres
Copy link
Author

Changes done @pedrobaeza @Tardo please review

@Tardo
Copy link
Member

Tardo commented Jun 3, 2019

@victormmtorres thx, good work!

on_click: function() {
var email_error = !this.$email.val().match(/.+@.+/),
_onClick: function() {
function validateEmail(sEmail) {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry @victormmtorres I don't fully understand what you want to achieve here 🙂 You should not need to validate email here don't you? You already have that in the main method: https://github.com/odoo/odoo/blob/12.0/addons/website_mass_mailing/static/src/js/website_mass_mailing.js#L41-L64

Copy link
Author

Choose a reason for hiding this comment

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

I will change this part

yajo and others added 7 commits June 14, 2019 14:03
Let you have the name field in the mass mailing subscription snippet.

Leave most logic to base module.

Make name field autofilled if user data is available.

Add tour test.
Test does not work, probably due to the framework. Leaving out the last step and hope for the best for v9.
[FIX]website_mass_mailing_name: Show disabled name.

When the snippet appears as disabled, do not hide the name field.
- Relicense to LGPL.
- Fix all known issues.
- Enable tour only in demo instances.
- Fix Sass headers.
- Remove compiled css and maps.
- Update JS modules to new api.
- Update tour to new tours api.
- Update module structure to match latest template.
Under some integration environment, the public part of the tour fails to load, I don't know exactly why (or better, I don't know why it was working before, because it was deleting the phantomjs session entirely).

In any case, with this fix, it works there and is faster to test.
@victormmtorres
Copy link
Author

@yajo please help me out as none of the suggested changes are working and I spend some time investigating and I believe at least the validation for email should work

@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from 3901215 to 19a3e30 Compare June 17, 2019 08:11
@victormmtorres
Copy link
Author

Changes done @chienandalu @yajo

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Thanks @victormmtorres !

if (email_error || name_error) {
this.$target.addClass("has-error")
_onClick: function() {
var email_valid = this.$email[0].reportValidity(),
Copy link
Member

Choose a reason for hiding this comment

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

I still think we're checking this twice. Anyway, not blocking.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but there's a reason for that.

If we do it like it is now, UX is way better. The user gets a clear bubble indicating where the problem is. Maybe it's a wrong email, or maybe it's an empty field.

If we rely on upstream validation, it would just set all red (in fact, both fields) and say nothing. It's OK if there's only one field, but now that there are 2, if they are validated in different ways, it gets inconsistent.

The way odoo does it supports very old browsers, but has the problems explained in odoo/odoo#14942.

However it's true that you can add a comment explaining why we're duplicating this validation here, @victormmtorres.

Copy link
Member

Choose a reason for hiding this comment

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

Add the comment and I'll merge

Copy link
Member

Choose a reason for hiding this comment

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

Add the comment and I'll merge

Copy link
Author

Choose a reason for hiding this comment

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

comment added

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@victormmtorres victormmtorres force-pushed the 12.0-mig-website_mass_mailing_name branch from 19a3e30 to 2ff470b Compare June 17, 2019 09:54
@yajo yajo merged commit a3706b5 into OCA:12.0 Jun 17, 2019
@yajo yajo deleted the 12.0-mig-website_mass_mailing_name branch June 17, 2019 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants