Commit Graph
799 Commits
Author SHA1 Message Date
Jacques Le Roux c3a6636e40 Improved: Use gradlew npm_outdated gradle-node-plugin taks to check outdated scripts (OFBIZ-12480)
I just tried g npm_outdated undocumented Gradle task and got this result*:

> Task :npm_outdated
Package         Current  Wanted  Latest  Location
dompurify         2.3.3   2.3.4   2.3.4  ofbiz-framework
jquery            3.5.1   3.6.0   3.6.0  ofbiz-framework
jquery-migrate    3.3.1   3.3.2   3.3.2  ofbiz-framework
jquery-ui-dist   1.12.1  1.13.0  1.13.0  ofbiz-framework

This updates accordingly. I keep this task open as an umbrella tasks for similar
subtasks in future like we have OFBIZ-10213
2022-01-08 13:04:10 +01:00
Jacques Le Roux 83d0880ab8 Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
Updates flot from 0.8.2 to 4.2.2 using npm
2022-01-08 11:18:40 +01:00
bjugl 4ae01b94f1 Improved: Replace ELRTE plugin with Trumbowyg (OFBIZ-10093) (#425)
Thanks: Jacques for inspiration and guidance, Aditya Sharma for sharing
thoughts and visions and Ingo Richter for finding this gem.

- changed grid 'EditProductPriceRulesCondition' list-name to reflect
correct list
2022-01-07 12:16:27 +05:30
Nicolas Malin 7341e5662c Fixed: Screen Xml renderer failed on renderContainer[Begin,End] ftl macro (OFBIZ-12478)
This complete the previous Improvement, Rendering different HTML container types with ScreenRenderer (OFBIZ-10495), where the xml macro are forgotten.

In same time resynchronise also missing macro renderColumn*
2022-01-03 10:22:48 +01:00
Jacques Le Roux fce5d349f5 Improved: Improve Helveticus theme (OFBIZ-12276)
Tentative to fix issues reported by SonarCloud:
  Unexpected shorthand "margin" after "margin-right"
  Unexpected duplicate "padding"

Also try changes for INFRA-22689
"No status emails sent to commits@ofbiz.apache.org"
2022-01-02 09:16:18 +01:00
Jacques Le Roux 47d8fea5fd Fixed: Bug in HtmlFormMacroLibrary.ftl::makeHyperlinkString macro (OFBIZ-12468)
I was unable to reproduce the error, but according to
https://stackoverflow.com/questions/51524640/why-does-freemarkers-built-in-is-string-return-true-for-an-object
The solution is to check for targetParameters not being an hash

Actually this was not the reason of the 1.7GB console log, another Jira to come
2021-12-18 11:58:54 +01:00
Jacques Le Roux 504c3fcf1c Improved: no longer needed, IE8 is totally deprecated 2021-12-10 11:42:10 +01:00
Jacques Le Roux 49362441b7 Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
After checking that we don't have any possible vulnerability using
jquery-ui-dist (ie 1.12.1) vs jquery-ui (1.13.0) based on* and checking in code
I decided to use jquery-ui-dist from npm. I just had to modify OfbizUtil.js to
get back to element.form() (for 1.12.1) vs element._form() for 1.13.0

I hope the npm jquery-ui-dist package will be updated soon. The release of
1.13.0 is quite fresh (<1 month).

We also need a mechanism to check the update or our npm packages.
As Aditya explained:
<<Minor updates can be handled implicitly by node when specified with tilde
range or caret range for version. For major updates, we just have to change
the version and use npm install.>>
So for now it will be manual. Later something like** could be used (I wonder
about https://snyk.io/, but that needs Infra agreement)

* https://blog.jqueryui.com/2021/10/jquery-ui-1-13-0-released/
** https://dev.to/dennismphil/automate-your-node-dependency-updates-4aga
2021-11-11 16:05:35 +01:00
Jacques Le Roux a201894d5c Improved: Fix OFBiz specific Javascript security issues reported by GH CodeQL (OFBIZ-12366)
Oops, fixes a syntax issue
2021-11-11 09:03:32 +01:00
Jacques Le Roux b38fd52e1f Improved: Fix OFBiz specific Javascript security issues reported by GH CodeQL (OFBIZ-12366)
Reassures CodeQL that all is correct, even if it was already OK
2021-11-11 07:46:20 +01:00
Jacques Le Roux 554dace63d Improved: Fix OFBiz speficic Javascript securiy issues reported by GH CodeQL (OFBIZ-12366)
Non functional change to test codeQL setting
2021-11-10 20:53:00 +01:00
Jacques Le Roux 9e89930e00 Fixed: Fix OFBiz speficic Javascript securiy issues reported by GH CodeQL (OFBIZ-12366)
Previously in commit dfc7ee4 I blindly followed GH CodeQL's advice about js CSS.
I had a doubt, indeed it was irrelevant. I misinterpreted the advice.

Then I tried to follow OWASP's advice about using node-esapi but was unable to
make it work in a reasonable time. Neither with "node require" nor requireJS;
ie using either CommonJS or AMD format, I guess I missed something there.

Anyway, I finally I set my sights on DOMPurify which is doing the job.

There is only one "foot-gun potential":
https://github.com/cure53/DOMPurify#user-content-is-there-any-foot-gun-potential
"If you first sanitize HTML and then modify it afterwards, you might easily void
the effects of sanitization. If you feed the sanitized markup to another library
after sanitization, please be certain that the library doesn't mess around with
the HTML on its own."

Fortunately, that's not a concern in our simple case.

This commit
* fixes the 3 remaining js vulnerabilty reported by
* prevents checking all under node_modules since it's done by npm in console
  (a bit weak though, ie not clearly on purpose)
* gives more information about 'ci' vs 'install' in npmInstallCommand
2021-11-10 16:08:02 +01:00
Jacques Le Roux dfc7ee4032 Improved: Fix OFBiz speficic Javascript securiy issues reported by GH CodeQL (OFBIZ-12366)
Fixes "A DOM text reinterpreted as HTML" issue in fieldlookup.js

GH CodeQL reports:
"A webpage with this vulnerability reads text from the DOM, and afterwards adds
the text as HTML to the DOM. Using text from the DOM as HTML effectively
unescapes the text, and thereby invalidates any escaping done on the text. If an
attacker is able to control the safe sanitized text, then this vulnerability can
be exploited to perform a cross-site scripting attack.

Recommendation
To guard against cross-site scripting, consider using contextual output
encoding/escaping before writing text to the page, or one of the other solutions
that are mentioned in the References section below.

Example
"Extracting text from a DOM node and interpreting it as HTML can lead to a
cross-site scripting vulnerability."

GH CodeQL suggest:
The above vulnerability can be fixed by using $.find instead of $. The $.find
function will only interpret target as a CSS selector and never as HTML,
thereby preventing an XSS attack.
2021-11-08 13:14:24 +01:00
Jacques Le Roux ce564ebc2a Improved: Try to reduce "Incomplete string escaping or encoding branch" issues reported by CodeQL (OFBIZ-12356)
GH CodeQL reports 556 "Incomplete string escaping or encoding branch" issues
(there are 588 issues at all).

Most of them are in jQuery-UI but not only. So this only an attempt to clarify
among the 23 pages reported by upgrading jQuery-UI to 1.13.0.
2021-10-31 15:29:30 +01:00
Jacques Le Roux bea540254f Improved: Update jquery-validation to 1.19.3 for security reason (OFBIZ-12339)
As reported at https://markmail.org/message/uof5ldk4o3x2ya33 I did not spot that
I also needed to commit the checksum change.

There is maybe more to do related to using "npm ci" instead of "npm install",
I'll check it out.
2021-10-18 13:18:54 +02:00
Jacques Le Roux d1da059464 Fixed: Update jquery-validation to 1.19.3 for security reason (OFBIZ-12339)
Dependabot installed at GH warned me about this vulnerability during pushing
2021-10-16 18:53:25 +02:00
Aditya Sharma 4bd30ce4d5 Implemented: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
Removed javascript for jQuery, jQuery Migrate, jQuery Browser and jQuery Validation from OFBiz sources. Instead these are now retrieved during the build as NPM packages using gradle-node-plugin.

Thanks: Aditya Sharma for implementation.
2021-10-12 20:50:41 +01:00
Jacques Le Roux dfc05edbab Improved: Remove Docbook parts now useless since Ascidoc is used for online help (OFBIZ-12327)
At https://markmail.org/message/inoihmcon37wq5zz I suggested:

If I'm not wrong, we no longer use Docbook anywhere. So I suggest to remove it
from:

1. cmssite component, where it was used by the online help, now assured by
    Asciidoc. BTW, for whom it could concern, I noticed that anchors jumping
    in adoc files does not work in online help
2. docbook.dtd in content component only used by the cmssite component
3. docbook.css in themes, I'm not sure that still useful there
2021-09-25 10:31:03 +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 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
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
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 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 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
Nicolas Malin e6b16a522d Fixed: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Reindent the less files to escape bad detection on SonaQube and correct type on css
2021-07-30 15:04:14 +02:00
Nicolas Malin c6c9b46d05 Fixed: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
SonarQube detect all "less variables" with space before ':' as a bug.

Align the syntax to solve or confirm the problem
2021-07-30 14:24:17 +02:00
Jacques Le Roux 36c489f51b Improved: Adds missing ASL2 headers in Helveticus less files 2021-07-27 17:04:20 +02:00
Nicolas Malin 1d2902be66 Improved: Add theme orientation color on Helveticus (OFBIZ-12288)
Some few improvement on Helveticus theme, where we add three other color red, yellow and green and increase the contrast on blue color.

Thanks to Marine Desmarchelier for this improvement
2021-07-22 11:12:55 +02:00
Jacques Le Roux 2c421cedfb Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo, hence the next, weirdly the trunk had
not this problem. Anyway better safe than sorry... Maybe related to Gradle
version or rather libs loaded?

The reason why the stable (and old) demos were not running is because the
EntitySaxReaderTests did not pass
2021-07-20 07:47:32 +02:00
Jacques Le Roux f360403647 Fixed: Fix issues reported by SonarQube analysis on Github (OFBIZ-12284)
Replaces wrong bgcolor by background-color
This is not only for Helveticus but other themes as well. I guess it was a C/P
from the oldest theme

I checked I see no real change in any of themes. I decided to not backport.

Remain few other bugs in Helveticus.
Not really knowing Less, I'm not sure about the helveticus-main-theme.less ones.
I don't know either how to bypass "false" reports
2021-07-17 10:33:37 +02:00
Nicolas Malin 7792565fcf Fixed: Improve js function OfbizUtil.ajaxSubmitFormUpdateAreas, some errors don't appear (OFBIZ-12268)
After the refactoring realized on issue OFBIZ-12268, a typo has been introduce when we scanned the presence of error during an ajax call.
The typo raised that ignore the case of an error is present as list.

The same typo is also present for event message list.

Thanks to Xin Wang to alert on this problem through issue OFBIZ-12272
2021-07-12 17:20:44 +02:00
Jacques Le Roux 0fd81b0296 Improved: Fixes licenses issues in *.less files from Rainbow Stone theme
Missed rainbowstone-main-theme.less in last commit
2021-07-09 22:28:08 +02:00
Jacques Le Roux 7bdc53d739 Improved: Fixes licenses issues in *.less files from Rainbow Stone theme
Removes tabs and trailing blanks in helveticus-main-theme.less as a "by product"
2021-07-09 21:28:39 +02:00
Nicolas Malin 894408cb0d Fixed: Link request-confirmation not generated on menus (OFBIZ-12278)
Menus link with request-confirmation and confirmation message do not generate the script that open confirmation

When you activate the following menu item :
      <menu-item name="statusToCancelled" title="${uiLabelMap.AccountingPaymentTabStatusToCancelled}">
          <link target="setPaymentStatus" request-confirmation="true" confirmation-message="You want to cancel this payment number ${payment.paymentId}?">
              ....
         </link>
      </menu-item>

OFBiz to not generate the js code link to the request-confirmation attribute because this functionality has been never implemented on java code for MenuRenderer

Thanks to Leila Mekika for raised this issue and solved it
2021-07-09 20:31:56 +02:00
Nicolas Malin 20d99d58ab Improved: Globalize the refresh on FindScreenDecorator (OFBIZ-11812) (OFBIZ-12261)
If you use a ComomnDynamicSingle form for realize a search, the FindScreenDecorator would be refresh all the container searchOptions + searchResult.

To keep the coherence, we move the screenStack resolution on the beginning of the decorator, and leave the searchResult to resolve it itself by usage of EmbeddedDecorator.

In practice to keep all dynamism on a search element :
  * Main screen with global decorator include the find screen wrap by main-decorator
  * The find screen include the search form and include the screen list result wrap by FindScreenDecorator
  * The screen result include the list result form wrap by EmbeddedDecorator
2021-07-07 10:50:51 +02:00
Nicolas Malin 3770cdbb38 Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
Complete previous commit with adding CommonDynamicGrid and CommonDynamicSingle form on common-theme previously forgot
2021-07-07 10:10:27 +02:00
Nicolas Malin 7120cf7d5f Implemented: Keep paginate list query on dynamic refresh (OFBIZ-12261)
When you display a list with search criteria, pagination information and/or sort parameters, if you update an element of this list with a update area, you loose all of them.

Example:

<form name="ListProductMeters" type="list" list-name="productMeters" target="updateProductMeter" paginate-target="ListProductMeters">
    <actions>
       <entity-condition entity-name="ProductMeter">...
    </actions>
    <auto-fields-service service-name="updateProductMeter"/>
    <field name="meterName"><text size="20"/></field>
    <field name="updateButton"><submit/></field>
    <on-event-update-area event-type="paginate"/>
    <on-event-update-area event-type="sort-column"/>
    <on-event-update-area event-type="submit"/>
</form>

Or this works well if you move an next page sort the list.
I realize the same principle for each event which do a modification of element in the list and after refresh it.

I also introduce the possibility to submit a form on modal (for edition) when you press 'enter' that will refresh the origin list.

Last point, the queryString element use to propage pagination state is also forwarded on callback element to keep this on update the list.

Thanks to Gil Portenseigne is help.
2021-07-02 17:27:21 +02:00
Nicolas Malin 2a509be3a9 Improved: Improve js function OfbizUtil.ajaxSubmitFormUpdateAreas (OFBIZ-12268)
At this time the function ajaxSubmitFormUpdateAreas present on themes/common-theme/webapp/common/js/util/OfbizUtil.js take a form, submit it thought ajax and wait a success to analyse a json result for update an area with the cvsAreaString given on parameter.

I realized different improvements :

 * refactoring some js code to centralize the analyze of json result for check if the call is a success or error
 * Analyze the content-type of the response if is a json continue as before, else take the return and update first area (useful for submit search or filtering form)
 * Manage the case who the ajax call failed and we inform the user
 * Add a trigger to force the modal close on submit success

Thanks to Leila Mekika, Marie-Aline Pantais and Gil Portenseigne for looking on that.
2021-07-02 17:17:07 +02:00
Jacques Le Roux 2cf1e9d490 Improved: Remove SVN references in build (OFBIZ-12267) (#305)
Fixes typos :/
2021-07-02 12:19:04 +02:00
Jacques Le Roux a80c12ae33 Improved: Remove SVN references in build (OFBIZ-12267) (#305)
Adds and simplify info about SIL license

Thanks: Xing Wang for suggestion at
https://github.com/apache/ofbiz-framework/pull/305#discussion_r662636202
2021-07-02 12:13:21 +02:00
Eugen Stan 1aaa2e7751 Improved: Remove SVN references in build (OFBIZ-12267) (#305)
Removed SVN references in git ant templates.
2021-07-01 20:23:47 +02:00
Nicolas Malin 8c8a56099b Implemented: Load new OFBiz theme Helveticus
(OFBIZ-12237)

Based on Rainbow Stone theme, The Helveticus theme is a modern relooking from Marine Desmarchelier.

Thanks to her for the proposal, Jacques Leroux, Leila Mekika and Gil Portenseigne for looking on that.
2021-06-28 17:57:59 +02:00
Gil Portenseigne 180b24c64e Improved: Improve rainbowstone theme (OFBIZ-12237)
Remove quicksand binary files, and add import from fonts.googleapis.com
to solve licencing issue.
Remove licence notice from the LICENCE FILE.
Fix theme link into README.
Fix some comments in javascript.css files.

Thanks Jacques for your guidance !
2021-06-28 17:45:51 +02:00