-
Notifications
You must be signed in to change notification settings - Fork 7
Correct the behavior of the Calendar component [APPS-02GT] #645
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
Conversation
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 fix the review comments below.
build.gradle.kts
Outdated
@@ -82,7 +82,7 @@ allprojects { | |||
pom { | |||
configureMavenCentralPom(project) | |||
} | |||
signPublication(project) | |||
// signPublication(project) |
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.
This change is to not be commited
@@ -2011,7 +2011,7 @@ abstract class VField protected constructor(width: Int, height: Int) : VConstant | |||
* Checks that field value exists in list | |||
*/ | |||
@Suppress("UNCHECKED_CAST") | |||
/*internal*/ fun selectFromList(gotoNextField: Boolean) { | |||
/*internal*/ fun selectFromList(gotoNextField: Boolean) { |
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.
Fix this indentation
block!!.getFieldPos(this), | ||
label, | ||
lab ?: name, | ||
toolTip) |
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.
Fix indentation
modeDesc, | ||
getTypeName(), | ||
getTypeInformation(), | ||
names) | ||
modeDesc, | ||
getTypeName(), | ||
getTypeInformation(), | ||
names) |
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.
Fix this indentation
galite-core/src/main/kotlin/org/kopi/galite/visual/ui/vaadin/form/DTextField.kt
Show resolved
Hide resolved
if (getModel().getDataType() == LocalDate::class){ | ||
getModel().block!!.activeField = getModel() | ||
} |
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.
We should generalise this. Since the problem is with field focus, do this instead :
if (!getModel().hasFocus()) {
getModel().block!!.gotoField(getModel())
}
Also, should we add the same check to DGridTextEditorField ?
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.
Using this treatment inside the old one returns the same results. As for whether we should add the same check to DGridTextEditorField, we don’t need that because grid fields are not editable in Galite. However, if the behavior changes, it may be necessary.
noEcho, | ||
scanner, | ||
noEdit, | ||
align, | ||
model.hasAutofill(), | ||
this) | ||
noEcho, | ||
scanner, | ||
noEdit, | ||
align, | ||
model.hasAutofill(), | ||
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.
Fix this code indentation
override fun toGui(modelTxt: String?): String? { | ||
override fun toModel(modelTxt: String?): String? { | ||
return modelTxt | ||
} | ||
|
||
override fun toModel(guiTxt: String?): String? { | ||
override fun toGui(guiTxt: String?): String? { |
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 don't see the point of these changes ?
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 made those changes just to make the function names more meaningful and aligns them with their respective purposes
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 think there is a misunderstanding :
ToGui function aims to transform a model text into a text to be interpreted by the GUI. In this case, the GUI text is the same as the model text this is why we return the model text value.
The same logic applies to the function toModel.
You should restore these functions to their previous states.
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.
Oh, okay, I'll undo the change.
9369753
to
ec37908
Compare
We corrected the indentation made by accident and made the issue more general by changing: if (getModel().getDataType() == LocalDate::class) {
getModel().block!!.activeField = getModel()
}
if (!getModel().hasFocus()) {
getModel().block!!.gotoField(getModel())
}
|
…in valueChanged of DGridTextEditorField [APPS-02GT]
I misunderstood DGridTextEditorField, I thought it was a field in dynamic reports. To ensure the same functionality, we'll apply the same logic of the valueChanged function in DTextField as in valueChanged of DGridTextEditorField. |
Synchronize the currentField property with activeField in the LocalDate case to ensure normal behavior when making changes in a field, as an assertion may occur if this condition is not met. This corrects the abnormal behavior, initially caused by this assertion, where date changes made by the Vaadin pop-up were not saved.