Commit Graph
27939 Commits
Author SHA1 Message Date
Nicolas Malin 73ec939db9 Fixed: Reformat PaymentServices.groovy
No functional change, review the code to down less it :
 * Use groovy syntax
 * Use DSL when is not use as it should
 * Set EntityQuery List or First on multiple line
 * use label and success(Map) DSL method
 * Remove redundant or unnecessary variable instanciation
 * Add missing variable type, for most ide analyser potential
2021-09-15 14:43:19 +02:00
Nicolas Malin 5bd3ccfa40 Improved: Groovy DSL add success(Map) method (OFBIZ-12317)
Improve the groovy dsl with a success method that return directly all fields

    Previously we used:
        Map result = success()
        result.myId = myId
        return result

    Now we can write:
        return success(myId: myId)

Or

    Previously we used:
        Map result = success('Wonderful !')
        result.myId = myId
        return result

    Now we can write:
        return success('Wonderful !', myId: myId)
2021-09-15 14:26:05 +02:00
Nicolas Malin f82f7631b1 Implemented: Groovy DSL add label method (OFBIZ-12319)
Improve the groovy dsl with a simple method 'label' to resolve an uiLabel instead of use 'UtilProperty.getMessage()' on groovy script.

    Previously we used:
        UtilProperties.getMessage("AccountingUiLabels", "AccountingUpdatePaymentPermissionError", 'locale'))

    Now we can write:
        label("AccountingUiLabels", "AccountingUpdatePaymentPermissionError")
2021-09-15 12:07:15 +02:00
Nicolas Malin fcd2c0cec8 Improved: Estimated shipping cost resolution with breaks on price and quantity (OFBIZ-6988)
On the service calcShipmentCostEstimate, each estimated shipment cost is analysed to resolve which ones should be applied on the order.
During the breakQtys block analysis, OFBiz checks if the estimate match the quantity with their breaks and validates if one is good.
If a rule contains multiple break type (ex: weight and price) this will be ignored or use as partial, only one break would be analysed.

To solve it we extend the analyse on the break type combinaison.

After a global code review, we reformat the function to down less code quantity for help the reader on:
 * use an Util function to resolve BigDecimal values
 * dedicate function to resolve the shipping address
 * dedicate function to validate a break type
 * move multiple loop to stream

 Thanks to Gil Portenseigne and Jacques Leroux for their look
2021-09-15 11:45:04 +02:00
Nicolas Malin c97d9e7010 Improved: Set Helveticus Theme as default (OFBIZ-12318)
As shared on dev mailing list thread [1], we set Helveticus as default theme

[1] https://s.apache.org/2cm25
2021-09-14 22:38:43 +02:00
Nicolas Malin 9c538612f5 Improved: Convert createPaymentAndPaymentGroupForInvoices service from mini-lang to groovy DSL (OFBIZ-11490)
Thanks to Sourabh Punyani for initiate the patch
2021-09-14 19:59:31 +02:00
Nicolas Malin 85c6220298 Improved: Convert updateSimpleTextContent service from mini-lang to groovy DSL (OFBIZ-11375)
Thanks to vivek singh bisen for initiate the patch
2021-09-14 14:50:52 +02:00
Nicolas Malin 46d53b513e Improved: Convert findAssocContent service from mini-lang to groovy DSL (OFBIZ-11369)
Thanks to Prakhar Kumar
2021-09-14 14:24:22 +02:00
Nicolas Malin dfb75fbcc7 Improved: Convert createSimpleTextContent service from mini-lang to groovy DSL (OFBIZ-11374)
Thanks to Sourabh Punyani
2021-09-14 14:04:41 +02:00
Nicolas Malin 65e955be88 Fixed: No functional change, simplify a conditional 2021-09-14 09:07:34 +02:00
Priya Sharma 7f0c5a78e1 Improved: Convert createPaymentApplication service from mini-lang to groovy DSL (OFBIZ-11481)
Done the following:
- removed mini-lang version of the service, added groovy version and updated the service definition
2021-09-14 08:50:23 +02:00
Saurabh Dixit 8d5dae6b65 Improved: Converted createPaymentFromOrder service from mini-lang to groovy DSL. (OFBIZ-11499) 2021-09-13 13:50:43 +02:00
Jacques Le Roux 7a22a2bfc9 Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 09:28:06 +02:00
Jacques Le Roux 67665d1a9e Fixed: Found a new XXE (XML External Entity Injection) vulnerability in ArtifactInfo (OFBIZ-12306)
The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
2021-09-13 08:10:14 +02:00
Wiebke Pätzold de1e9e4bb4 Improved: Convert ShoppingListServices.xml mini lang to groovy (OFBIZ-11602) 2021-09-11 12:46:15 +02:00
Sebastian Berg 7d40e0703a Improved: Convert RoutingServices.xml mini-lang to groovy (OFBIZ-11855) 2021-09-10 17:23:51 +02:00
Nicolas Malin fa3e3573dc Improved: Improve run test from artefact info (OFBIZ-12312)
From https://localhost:8443/webtools/control/ViewComponents we have te possibility to run each test case or test suite.

We improve it with call with rest schema (like https://localhost:8443/webtools/control/RunTest/product/producttagtests) and display the result below

By this way, we also improve the groovy syntax to slim the code and extend xml form to CommonBasicGrid

Thanks to Gil Portenseigne for is support
2021-09-10 10:17:23 +02:00
Nicolas Malin 4bb54a1d1c Improved: Improve login page for Helveticus Theme (OFBIZ-12313)
Update the login page for Helveticus theme to keep the same spirit.

Thanks to Marine Desmarchelier for her work
2021-09-09 18:33:50 +02:00
Gil Portenseigne ab9ca12221 Execute a callback with parameters from the request (OFBIZ-12262)
Transform workEffort creation using modal and callback system to
illustrate this improvement.

A new Attribute `from-event-result` is created for `set-callback`
parameters, to indicate that the callback should be called with a
parameter which value comes from the event result initiated by the link.

In this example, is retrieved from the workeffort creation event the id
needed to display the WorkEffortSummary screen of the new data.

A new pattern is created to encode in CALLBACK JWT token the data that
should be parsed from the event. The parsing occurs in javascript.
2021-09-07 14:56:20 +02:00
Nicolas Malin 192a3b7f5d Fixed: Setup instructions don't work (OFBIZ-12228)
The creation of a new company failed with constraint database error due to a missing functional General Ledger data.

To correct this, we separate the demo GlAccount demo data from Accounting demo data to allow it alone when we create the new company.

A second error can appear with the presence of a partyAcctgPreference if the validation isn't realized immediately, so we just add a control of the presence before call service createPartyAcctgPreference.

Thanks to Szabolcs Szekelyi for raise this issue and Jacques Leroux for its look
2021-09-06 17:16:03 +02:00
Jacques Le Roux ad1e06b9bd Improved: Update build.gradle to the latest dependencies (OFBIZ-12311)
The tests fails locally but it makes no sense, trying w/ BUilbot...
2021-09-06 10:06:41 +02:00
Nicolas Malin a83faaf15a Fixed: Rendering widget screen from ftl with the current context : java doc generation error (OFBIZ-12310)
Correction previous commit with invalid character on the javadoc.
2021-09-03 20:59:52 +02:00
Nicolas Malin 26a9dc7336 Implemented: Rendering widget screen from ftl with the current context (OFBIZ-12310)
Currently, when you would be rendering a widget screen from a ftl template, you can use a element screen present on context to call the renderer :

    ${screens.render("component://common/widget/CommonScreens.xml#countries")}

This rendering is realized with the context present when the object screen has been initialized.
To simplify the screen call from freemarker template, I implemented a new macro ofbizScreen
You can call a Ofbiz screen with the ftl context with simple macro

    <@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#MyScreen</@ofbizScreen>

You can also write

    <@ofbizScreen location="component://mycomponent/widget/MyComponentScreens.xml" name="MyScreen"/>

Or set a default location on your context
    action :
        context.defaultTemplateLocation = "component://mycomponent/widget/MyComponentScreens.xml"
    widget :
        <@ofbizScreen>MyScreen</@ofbizScreen>

When the screen would be call, the context to rendering the screen would be use the current context:

    <#list contactMechs as contactMech>
      <#assign contactMechId = contactMech.contachMechId/>
      <@ofbizScreen>component://mycomponent/widget/MyComponentScreens.xml#DisplayContactMech</@ofbizScreen>
    </#list>
2021-09-03 18:29:48 +02:00
Jacques Le Roux 9ea7c6d524 Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
Safer completing solution as recommended by weinull orz <weinull@outlook.com>
Previous commit was OK, but better be safe than sorry ;)

Also forgot to commit the DENIEDFILEEXTENSIONS checkstyle change last time

Thanks: weinull orz for the the right suggestion (done 2021-08-13)
2021-09-03 16:49:11 +02:00
Jacques Le Roux 3bfb03eaad Fixed: CVE-2021-37608 vulnerability bypass (OFBIZ-12307)
The fix I did is two folds:
filters extensions (thanks to Zhujie's suggestion of a list of extensions to ban)
deletes bad files at the right place (thanks to thiscodecc's report)

Thanks: thiscodecc for the security report
2021-09-03 13:47:15 +02:00
Jacques Le Roux 5d3d3944a9 Documented: Changes the link to issue tracker (Jira) to simplify things related to security 2021-09-01 09:58:14 +02:00
Nicolas Malin 3b593f8eda Improved: Propage product features from a marketing package (OFBIZ-12077)
When you create a product as a marketing package, you attempt when you ship this product to have the same constraint as you ship each product that compose it separately.

Marketing Package |  Composed product |  Product Feature
  GIFT_PACKAGE    |                   |
     1            |   GIZMO_HEAVY     |  (WEIGHT) HEAVY_SIZE
     2            |   GIZMO_TINY      |

On this example if I ordered a GIFT_PACKAGE, during the order process, currently you never see that you ordered a product with a feature HEAVY_SIZE, feature that can have some consequence for select a shipping method.

So when we need to analyze the features linked to a product, if the product is a marketing package, we propage the search to all products that compose it
2021-09-01 09:54:43 +02:00
Nicolas Malin fe542cfee1 Improved: Tooltips overload labels (OFBIZ-12277)
Adding new method to display tooltip on overload when we have a mouse hover on icon information to reduce
 text quantity for optional information.

 Add some other improvement :
  * remove bold on dynamic lookup return to avoid constant moving display
  * escape error when on TopappBar if display apps are not present

Thanks to Marine Desmarchelier and Gil Portenseigne for their works
2021-08-20 17:42:54 +02:00
Nicolas Malin 70ea85c533 Fixed: move crud QuoteTerm services to services_quote.xml
No functional change.

Move oriented Quote service to dedicate services_quote.xml instead the generic services.xml file
2021-08-18 17:10:20 +02:00
Gil Portenseigne a37d5cc5d5 Fixed: Jgrowl label are not well retrieved showing 'undefined' button (OFBIZ-12299)
Thanks to Xin Wang comments in https://s.apache.org/trrkk we discover
that label retrieval through javascript are not working.

One example exists, but is not functionnal and do not use jgrowl.

This commit allow jgrowl use directly from javascript (showjGrowlMessage(...))
while making label retrieval synchronous for Jgrowl and fromDate/thruDate existing
feature.

Clean up showErrorAlertLoadUiLabel that became orphan.
2021-08-18 09:29:10 +02:00
Nicolas Malin 92d3625153 Fixed: remove unnecessary quote on groovy map 2021-08-18 09:10:39 +02:00
Nicolas Malin bdd5673fe2 Fixed: Clean groovy file ContentServices.groovy
No functional change :
 * remove case syntax
 * use OFBiz dsl
 * condense map creation, entityCondition by builder
 * add typage to help ide and compilation

Fixed to bad engine on service createDownloadContent and updateDownloadContent after the minilang to groovy migration
2021-08-17 17:45:45 +02:00
Nicolas Malin 3fb6b40aa3 Fixed: Clean groovy file FindLookUp
No functional change :
 * remove case syntax
 * use groovy syntax (excepted on executeResult.listIt, EntityListIterator not support the groovy syntax *if (!listIt)*)
 * use Elvis operator for default values
 * add typage to help ide and compilation
2021-08-17 16:26:38 +02:00
Jacques Le Roux 2525377569 Improved: switch link from Nabble (no longer reachable) to Markmail
Only trunk is concerned (OFBIZ-11998)
2021-08-11 17:08:38 +02:00
Nicolas Malin 3dd89a5219 Fixed: Fix checkstyle issue
detected by the buildbot and not by ./gradlew check
2021-08-11 14:59:47 +02:00
Eugen Stan 25c75e2839 Implemented: Clojure Service engine (OFBIZ-12302) (#317)
* Added Clojure service and service test and example service
* Added clojure engine
2021-08-10 16:09:39 +02:00
Jacques Le Roux 54acc03858 Fixed: SecuredUpload::isValidTextFile wrong check with uppercase (OFBIZ-12301)
In SecuredUpload::isValidTextFile a wrong check is done

Thanks: Zhujie from Ping'an Technology
2021-08-10 13:02:52 +02:00
Nicolas Malin 6addbdc208 Implemented: Convert WorkEffort relation screen to dynamic Compound (OFBIZ-12292) (#318)
After the work on the task OFBIZ-11808, the work on issue OFBIZ-12272 to improve
FindWorkEffort and suggest converting dynamic screen with compound widget, we tried
to migrate all screen link to entity workEffort with idea to down less the code,
remove all css information to let the theme do it and use widget improvement
developed last years (focus, extend, displaying)

The migration cover FindWorkEffort, ListWorkEffortPartyAssigns,
 ListWorkEffortFixedAssetAssigns, ListWorkEffortCommEvents, ListWorkEffortShopLists,
 ListWorkEffortRequests, ListWorkEffortRequirements, ListWorkEffortQuotes,
 ListWorkEffortOrderHeaders, EditWorkEffortTimeEntries, EditWorkEffortNotes,
 EditWorkEffortContents, EditWorkEffortGoodStandards, EditWorkEffortReviews,
 EditWorkEffortKeywords, EditWorkEffortContactMechs, EditAgreementWorkEffortApplics,
 ListWorkEffortAttributes, ListWorkEffortEventReminders

Thanks to Leila Mekika, Marie-Aline Pantais, Gaëtan Chaboussie and Gil Portenseigne for their help
2021-08-09 10:50:44 +02:00
Jacques Le Roux 46433e85b7 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
"moz-linear-gradient(bottom" should be better than "moz-linear-gradient(to bottom"
2021-08-06 17:14:40 +02:00
Jacques Le Roux 4d3039c5de Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
SonarQBE did not detect bug put in in ModelInduceFromDb.jsp by 13d6bc2,
found it by chance

"moz-linear-gradient(bottom" should be better than "moz-linear-gradient(to bottom"
2021-08-06 17:07:58 +02:00
Jacques Le Roux 9ad9cd6a2f Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Makes moz-linear-gradient the same than webkit-gradient. Both should be replaced
by linear-gradient but that's another issue...

Second try, based on search on Net
2021-08-06 16:41:29 +02:00
Jacques Le Roux cdf7d23686 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Makes moz-linear-gradient the same than webkit-gradient. Both should be replaced
by webkit-gradient linear-gradient but that's another issue...
2021-08-06 16:15:24 +02:00
Jacques Le Roux 4cedb5183f Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Removes useless empty
.contentarea {
}
2021-08-06 12:35:07 +02:00
Jacques Le Roux f6a0acbd12 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fixes issues in helveticus-main-theme.less file. Not quite sure about removing
padding:2rem;
but should be OK
2021-08-06 12:33:30 +02:00
Jacques Le Roux 13d6bc2913 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Those should be OK, for instance I see no reasons to do something like that:
window.location.href = window.location.href;
2021-08-06 11:45:30 +02:00
Jacques Le Roux 42ce0f6cfd Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
I guess a space is needed after question mark for CSS expression when using
ternary operator
2021-08-06 10:54:28 +02:00
Jacques Le Roux 9708d22afe Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Same than what Nicolas did before:
<<SonarQube detect all "less variables" with space before ':' as a bug.>>
2021-08-06 10:48:26 +02:00
Jacques Le Roux 55fa3d1154 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Another fake change in .sonarcloud.properties to test setting changes in
GitHub sonarQBE UI
2021-08-06 10:38:58 +02:00
Jacques Le Roux 1459e1f6c8 Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Fake change in .sonarcloud.properties to test setting changes in sonarQBE
following
https://sonarcloud.io/documentation/advanced-setup/analysis-scope/
and
https://sonarcloud.io/project/settings?category=exclusions&id=apache_ofbiz-framework
2021-08-06 10:15:39 +02:00
Jacques Le Roux 59ef7a4c9e Improved: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Not sure all is exact, rather a try...
2021-07-30 19:04:34 +02:00