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

Vulnerability upgrades backwards compatibility #656

Conversation

junaidwarsivd
Copy link
Contributor

No description provided.

widget.value.translated=true
enable.backward.compatability=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this to easy_rule.v3.compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All changes mentioned are updated according the suggestion @ekigamba

@@ -1428,11 +1428,12 @@ private Facts getEntries(String[] address, JSONObject object) throws JSONExcepti
formObject.put(RuleConstant.IS_RULE_CHECK, true);
formObject.put(RuleConstant.STEP, formObject.getString(RuleConstant.STEP));

if(Utils.enabledProperty(NativeFormsProperties.KEY.ENABLE_BACKWARD_COMPATIBILITY)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Go to Code > Reformat code to automatically fix any spacing eg after the if block to if (Utils...

@@ -23,6 +23,7 @@ public final static class KEY {
//Widgets
public static final String WIDGET_DATEPICKER_IS_NUMERIC = "widget.datepicker.is.numeric";
public static final String WIDGET_VALUE_TRANSLATED = "widget.value.translated";
public static final String ENABLE_BACKWARD_COMPATIBILITY = "enable.backward.compatability";
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this constant to EASY_RULES_V3_COMPATIBILITY

@@ -31,7 +32,7 @@ public class DiskFileSource implements FormFileSource {
private MVELRuleFactory mvelRuleFactory;

private DiskFileSource() {
this.mvelRuleFactory = new MVELRuleFactory(new YamlRuleDefinitionReaderExt());
this.mvelRuleFactory = new MVELRuleFactory(new YamlRuleDefinitionReaderExt());
Copy link
Contributor

Choose a reason for hiding this comment

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

Kindly make this optional by switching to YamlRuleDefinitionReader or YamlRuleDefinitionReaderExt

@@ -26,7 +27,7 @@ public class AssetsFileSource implements FormFileSource {
private MVELRuleFactory mvelRuleFactory;

private AssetsFileSource() {
this.mvelRuleFactory = new MVELRuleFactory(new YamlRuleDefinitionReaderExt());
this.mvelRuleFactory = new MVELRuleFactory(new YamlRuleDefinitionReaderExt());
Copy link
Contributor

Choose a reason for hiding this comment

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

Kindly make this optional by switching to YamlRuleDefinitionReader or YamlRuleDefinitionReaderExt

@@ -1939,6 +1940,7 @@ private List<String> getRules(String filename, String fieldKey, boolean readAllR

StringBuilder conditionString = new StringBuilder();
conditionString.append(map.get(RuleConstant.CONDITION).toString());
boolean backwardCompatibility = Utils.enabledProperty(NativeFormsProperties.KEY.ENABLE_BACKWARD_COMPATIBILITY);
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this variable to be more accurate eg jEasyRulesV3Compatible

@ekigamba
Copy link
Contributor

ekigamba commented Mar 2, 2023

@junaidwarsivd We can merge this into #655 and I can review the requested changes from #655

@junaidwarsivd junaidwarsivd merged commit 1191828 into vunerability-upgrade Mar 2, 2023
@junaidwarsivd junaidwarsivd deleted the vunerability-upgrades-backwards-conpatibility branch March 2, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants