Skip to content

Fix for Issue #4136, MAGETWO-53440 #14485

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

Conversation

vasilii-b
Copy link

Description

Full description in #4136.
✔️ Added calendar initialization for Conditional Rules when a rule is created for the 1st time

For the condition type date the datepicker was not initialized when creating new conditions.

This PR aims to solve the issue and do not allow the user to write anything to the input.

Fixed Issues (if relevant)

Issue described in #4136

Manual testing scenarios

Described in #4136

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Apr 1, 2018

CLA assistant check
All committers have signed the CLA.

@vasilii-b vasilii-b force-pushed the issue-4136-2.2-develop branch from 1f98ac3 to 15242c0 Compare April 1, 2018 10:51
Added calendar initializaton for Conditional Rules when a rule is created for the 1st time
@magento-engcom-team magento-engcom-team added this to the April 2018 milestone Apr 2, 2018
@magento-engcom-team magento-engcom-team added Release Line: 2.2 partners-contribution Pull Request is created by Magento Partner Partner: Atwix Pull Request is created by partner Atwix labels Apr 2, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-1205 has been created to process this Pull Request

@okorshenko okorshenko modified the milestones: April 2018, May 2018 May 18, 2018
@okorshenko okorshenko removed this from the May 2018 milestone May 31, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-1205 has been created to process this Pull Request

@rogyar
Copy link
Contributor

rogyar commented Aug 11, 2018

Hi @vasilii-b. There's still a possibility to write text in the datepicker input. Check the following scenario:

magetwo 2018-04-02

@vasilii-b
Copy link
Author

Thank you, @rogyar . Will have a look on that.

@vasilii-b
Copy link
Author

@rogyar, a fix was added for the provided scenario. Thank you!

@@ -377,6 +377,9 @@
.addClass('v-middle')
.text('') // Remove jQuery UI datepicker generated image
.append('<span>' + pickerButtonText + '</span>');

$(element).attr('autocomplete', 'off');
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @vasilii-b. Thanks for the collaboration. This fix removed autocomplete in all scenarios. Are you sure that is the right approach?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @VladimirZaets,
here is a good point where we can have a long discussion, I believe.
Yes, I intended to disable the autocomplete for all scenarios and here is why.

It all started from the thing that the datepicker goal is to provide the user a possibility to select the date, not to write it by hand. The input I believe should be informative only, because the input is the date picker itself. I'd suggest making the datepicker input readonly at all.

Secondly, from the autocomplete there may come values in different format than is needed by the datepicker.
Let's say on Website A there is input with name date that has format DD/MM/YYYY, on Website B there is an input with the same name (date) but the format is MM/DD/YYY. So on Website A user set his desired date and when comes on Website B browser suggests him the previous date (from Website A) - which is wrong because of the date format.

Please let me know your thoughts on this.
Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

I will as product manager, because it more related to the produce manager that to developer.

Anyway, I think we should add the configuration option to manage this situation and provide a choice to using this component in each case

Copy link
Author

Choose a reason for hiding this comment

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

@VladimirZaets sounds reasonable. I'll add the additional configuration.
Thank you!

@sidolov
Copy link
Contributor

sidolov commented Sep 4, 2018

Hi @vasilii-b , I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@sidolov sidolov closed this Sep 4, 2018
@vasilii-b vasilii-b reopened this Oct 13, 2018
@vasilii-b
Copy link
Author

Hi @sidolov,
Sorry for letting this happening. I've replied to @VladimirZaets and waiting for his thoughts on that matter.
Thank you!

@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-3357 has been created to process this Pull Request

…acter not preventing from saving

- Restricted user to change date input value
- Open datepicker popup once user click on the date to be changed
@vasilii-b vasilii-b force-pushed the issue-4136-2.2-develop branch from 71dca3d to 6c87bb3 Compare November 8, 2018 11:44
@vasilii-b
Copy link
Author

Hi @VladimirZaets,
I've found a different place, more specific for changes I've added. Also, the user interaction is changed: user can change the date only by using datepicker - input is not more available for direct editing:
2018-11-08 18 00 28
Please let me know your thoughts.
Thanks!

@vasilii-b
Copy link
Author

@VladimirZaets, please let me know if newly changes are fine for you. Thanks!

…acter not preventing from saving

- Added autocomplete option for calendar.js
@vasilii-b
Copy link
Author

Hey, what's the status of this one ? Accepted or need some more attention ? Thank you!

@magento-engcom-team
Copy link
Contributor

Hi @vasilii-b. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@vasilii-b vasilii-b deleted the issue-4136-2.2-develop branch November 24, 2018 13:16
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.

8 participants