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
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)
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")
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
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.
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
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>
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)
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
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
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
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.
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
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
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
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"
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