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
fixed issue edit pattern not applied #1030
base: dev
Are you sure you want to change the base?
Conversation
d848697
to
dc980d7
Compare
@@ -78,10 +79,10 @@ | |||
this.widgetObject = new DatePickerWidget(this, this.getWidget(), model); | |||
} | |||
if (this.widgetObject.getValue() !== '') { | |||
this._model.value = this.widgetObject.getValue(); | |||
super.updateFormattedDate(this.widgetObject.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep the changes simple here, no new class for now
if (editFormat) {
this._model.value = parse(...,...);
} else {
this._model.value = this.widgetObject.getValue()
}
And fix af2-web-runtime to allow setting date objects in value.
...t/apps/core/fd/components/form/datepicker/v1/datepicker/clientlibs/site/js/datepickerview.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check comments
197f8ca
to
4f4a747
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1030 +/- ##
=========================================
Coverage 80.40% 80.40%
Complexity 738 738
=========================================
Files 91 91
Lines 2057 2057
Branches 273 273
=========================================
Hits 1654 1654
Misses 251 251
Partials 152 152 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please incorporate the comments and update the PR
fcefb12
to
b77491d
Compare
b77491d
to
20b2c94
Compare
after picking from fixed calendar typed date not updating
20b2c94
to
46883e6
Compare
1069f9d
to
8b4ab7e
Compare
@@ -195,7 +197,8 @@ describe("Form Runtime with Date Picker", () => { | |||
|
|||
it("Test order of the days", () => { | |||
const [datePicker7, datePicker7FieldView] = Object.entries(formContainer._fields)[6]; | |||
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible").click().then(() => { | |||
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible") | |||
.eq(0).click({force: true}).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you changed the existing test suite ? Isn't this a breaking change ? Ideally with your changes, you only need to add a new test spec. Please remove the changes to the existing test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests were failing because all the calendar icons are on top right of the page and overlapping each other.
They were failing after I added test cases and were probably flaky earlier also.
const [datePicker7] = Object.entries(formContainer._fields)[6]; | ||
|
||
cy.get(`#${datePicker7}`).find(".cmp-adaptiveform-datepicker__calendar-icon").should("be.visible") | ||
.eq(0).click({force: true}).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No use of force:true on runtime test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force true is used because the calendar icons are overlapping each other because the test collaterals do not have css
setModel(model) { | ||
super.setModel(model); | ||
if (!this.#noFormats()) { | ||
if (this.widgetObject == null) { | ||
this.widgetObject = new DatePickerWidget(this, this.getWidget(), model); | ||
} | ||
if (this.widgetObject.getValue() !== '') { | ||
this._model.value = this.widgetObject.getValue(); | ||
this._model.value = this.getFormattedDate(this.widgetObject.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you are basically trying to get the data value which is in ISO format from a formatted value. We should have a function for this in af-core and direcly use it, rather than copying the entire logic of formatters here ? @vdua IIRC, we do have some utility for this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, but I asked @egmox to create it in runtime. I would suggest making editValue writable property and set this._model.editValue = user entered value
and the setter should parse it accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check comments
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: