Commit Graph
10239 Commits
Author SHA1 Message Date
Jacques Le Roux b1e48eef37 Improved: makes ScreenFopViewHandler::render debug area also usable on Windows 2020-06-29 11:47:23 +02:00
Pawan Verma 031592cc32 Fixed: EntityQuery queryCount is throwing error with distinct method (OFBIZ-11294)
Added missing support for selectFields in queryCount and all the subsequent methods.

Thanks: Deepak Dixit for the review.
2020-06-28 01:40:58 +05:30
Priya SharmaandPriya Sharma 5a144c0bed Improved: Use GroovyBaseScript's makeValue utility methods in each Groovy files (OFBIZ-11779)
Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-06-28 01:24:32 +05:30
Pawan Verma 3da16a182c Improved: Replace Collection.sort() with List.sort().(OFBIZ-11830) 2020-06-28 01:21:23 +05:30
Pawan Verma e19b12eae9 Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is already done in the declared type.
2020-06-28 01:04:51 +05:30
Priya SharmaandPriya Sharma 0f9307c071 Improved: Convert InvoicePerShipmentTests.xml tests to groovy (OFBIZ-11553) (#208)
* Improved: Convert InvoicePerShipmentTests.xml tests to groovy (OFBIZ-11553)
Done following:
- converted all xml test implementation to groovy
- used MockHttpServletRequest MockHttpServletResponse objects for triggering the events
- removed the xml version of the test implementations
- updated the test service mapping in the invoicetests.xml
(OFBIZ-11553)

* Improved: Moved the common code into a method so as to avoid duplication of code.
- passed in two parameters i.e. product id and the invoicePerShipment flag, to be used as per the need of the testcase.
(OFBIz-11553)

* Improved: Added support to get access to the Debug log methods in the groovy tests. (OFBIZ-11553)
- Also updated the references in the InvoicePerShipment tests.

Co-authored-by: Priya Sharma <priya.sharma@hotwaxsystems.com>
2020-06-27 18:09:34 +05:30
Pawan Verma f0af2894e5 Improved: Merge identical catch blocks in single catch block(OFBIZ-11827)
In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.

Thanks: Jacques for the review.
2020-06-27 11:23:12 +05:30
Pawan Verma 4275825b4a Improved: Replace anonymous types with lambda expressions(OFBIZ-11833) 2020-06-24 14:11:05 +05:30
Pawan Verma 2a4a617d0d Improved: Replace try-finally with try with resources(OFBIZ-11826)
Set checkstyleMain.maxErrors to 26678 (-4)

Thanks: Jacques for the review.
2020-06-22 21:32:42 +05:30
Pawan Verma 30732dd57b Improved: Replace Map.get() with Map.getOrDefault() method.(OFBIZ-11832)
Set checkstyleMain.maxErrors to 26682 (-2)
2020-06-22 21:26:18 +05:30
Pawan Verma 18f5dadd93 Improved: Replace single method call lambda with method reference(OFBIZ-11835)
Thanks: Jacques for the review.
2020-06-22 20:59:44 +05:30
James Yong 4dbdf720c5 Fixed: Apply multi-block attr to each application (OFBIZ-11706)
Rendering screen within freemarker template not done correctly when multi-block=true

Thanks: Jacques for reporting
2020-06-19 23:09:17 +08:00
Jacques Le Roux 743c790a36 Fixed: getEntityRefData service has a weird issue (OFBIZ-11401)
It's reproductible on trunk demo though only visible in log, UI shows no issue

R17 and R18 are also affected, R16 is OK.

Ankush: This stacktrace should be coming for all entities where
default-resource-name is defined on entity definition but no property exist in
defined resource for key EntityDescription.entityname and FieldDescription.field.

As we want to have these entity labels as much as possible, we can simply print
warning about the missing entity descriptions and field descriptions for
readability purpose instead of printing huge exceptions stacktrace.

Thanks: Ankush Upadhyay and Pierre Smits for the help
2020-06-18 17:39:49 +02:00
James Yong 3a13afe811 Fixed: showHelp not working (OFBIZ-11803)
Cater for page that uses layoutSettings.VT_STYLESHEET
instead of layoutSettings.styleSheets
2020-06-18 23:29:02 +08:00
Pawan Verma 43747764bc Improved: Change resources with proper naming convention in framework(OFBIZ-11834)
Also, modified checkstyleMain.maxErrors to 26735(-24)

Thanks: Jacques and Suraj for review.
2020-06-18 15:30:00 +05:30
holivier da690493f9 Fixed: Check embedded Javascript libs vulnerabilities using retire.js
(OFBIZ-11752)

Upgraded jQuery to 3.5.2 and jQuery migrate to 3.3.0 to vulnerabilities
of medium severity
    Regex in its jQuery.htmlPrefilter sometimes may introduce XSS;
https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

change in HelpScreen.xml
2020-06-17 14:34:51 +02:00
Jacques Le Roux 50fa929b83 Improved: Clean code according to SpotBugs and Eclipse (OFBIZ-11824)
Handles 2 possible NPR reported by SpotBugs
Removes the unused createPrimaryKeyFetcher method as reported by Eclipse
Reformats modified code to stay into 150 chars by line and other style issues
Sets tasks.checkstyleMain.maxErrors to 26759 (-1)
2020-06-17 10:07:00 +02:00
Jacques Le Roux 488b9b6b9a Improved: Checks if the value passed to checkStringForHtmlSafe is not null (OFBIZ-11822)
This was reported by SpotBugs in Eclipse to prevent a possible NPE.

It seems to me that it's more complex than that because of the
PolicyFactory::sanitize methods signatures where @Nullable annotation is
used. So the SpotBugs warning remains, anyway can't hurt.

BTW found 92 issues reported by SpotBugs in Eclipse, among them 33 are "scary"

I had to add 1 to tasks.checkstyleMain.maxErrors because of
https://github.com/apache/ofbiz-framework/pull/203 that I pulled after the push
was rejected by the pre-push local Git hook
2020-06-16 14:05:16 +02:00
Jacques Le Roux df828419be Fixed: Double encoded urls are not being decoded (OFBIZ-11822)
This was broken by OFBIZ-10275

Thanks: Alex Bodnaru
2020-06-15 13:25:35 +02:00
Jacques Le Roux 88bda0b4dc Improved: Install a Checkstyle pre-push (on every committer machine?) (OFBIZ-11304)
Updates tasks.checkstyleMain.maxErrors to 26842
Remove a trailing space in RequestHandler I used to test the pre-push hook.

In the previous commit (c4b5f5e) I have pushed a pre-push hook rather than a
pre-commit hook. I think it makes sense. I noticed that this does not clear the
existing pre-commit hook in .git\hooks. You have to clear it by hand.

But anyway I believe we should rather use a webhook as Suggested by Samuel and
proposed by Infra. This for at least 3 reasons:
    Handles PRs and not only local commits
    Minimise the CPU usage locally
    Simplify usage for custom projects

I think it's the best solution but I'll continue the discussion on dev ML about
2020-06-13 10:09:48 +02:00
Jacques Le Roux c4b5f5ec2c Test locally <<hooks = ['pre-push': 'checkstyleMain']>> 2020-06-13 09:41:59 +02:00
James Yong 33deb94501 Improved: Allow definition of external style sheet in multi-block html template (OFBIZ-11819)
External style sheet in html template will be extracted to layoutSettings.styleSheets when multi-block=true.
2020-06-12 14:12:45 +08:00
Priya SharmaandPriya Sharma 5c5af78ffe [Improved]: Overloaded groovy utility method to handle error logging with only throwable object as parameter. (OFBIZ-11762) (#194)
Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-08 13:35:15 +02:00
James Yong f21dbd6d74 Improved: multi-block attribute for html-template tag (OFBIZ-11686)
Add CSRF token support for 'getJs' request uri.
2020-06-07 14:33:16 +08:00
Suraj Khurana c00e61aa18 Improved: Enforce noninstantiability to LoginWorker class. (#175)
(OFBIZ-11747)

Made class as final, added private constructor and made static variables as private.
2020-06-07 10:55:06 +05:30
James Yong 4e563a67ff Fixed: showHelp not working (OFBIZ-11803)
Fixed Navigation tree is not displayed in showHelp page.
2020-06-06 19:49:26 +08:00
Priya SharmaandPriya Sharma 15aec7e8f7 WIP: [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762) (#185)
* [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug
- Replaced the debug.log methods with the respective groovy utility method
- Enhanced the GroovyBaseScript to entertain the fetch the current class name as the module name for logging
- Overloaded the logError method to entertain throwbale object for better logging
- Removed unused import statements and module variables.

(OFBIZ-11762)

* [Removed]: Extra line spaces. (OFBIZ-11762)

* [Revert]: Unwanted changes. (OFBIZ-11762)

* [Added] Same changes to these files. (OFBIZ-11762)

Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-06 10:17:23 +02:00
James Yong e3f6d1547f Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Fix regression in scrumtests that resulted in NullPointerException.
2020-06-06 14:28:32 +08:00
Suraj Khurana 846e5f0ded Improved: Enforce noninstantiability to GroovyUtil Class. (#180)
(OFBIZ-11778)

Made class as final, moved default constructor and renamed private data members as per naming convention best practices.
2020-06-06 10:03:33 +05:30
Suraj Khurana 924df4b217 Improved: Enforce noninstantiability to ConfigXMLReader Class (#178)
(OFBIZ-11746)

Made class as final, added private constructor and corrected private data members as per naming convention.
2020-06-06 10:01:55 +05:30
James Yong 347ea63479 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Improve function for adding links to layoutSettings
2020-06-06 10:23:41 +08:00
holivier 211540a966 Documented: Help link using asciidoc files via generated html
(OFBIZ-11693)

Migrate AccountingHelData.xml to added some <set field="helpAnchor" to
the correct screens

Now in accounting component only asciidoc documents are used, help link
area now link to userDocUri
(ci.apache.org/projects/ofbiz/site/trunk/ofbizdoc as default value in
general.property)
2020-06-05 15:15:21 +02:00
holivier 192059e3da Improvement: Help link using asciidoc files via generated html
(OFBIZ-11693)

Change release for all asciidoc files, now there area 3 publish site,
one per release
* site/trunk
* site/next   currently for the 18.12
* site/stable currently for the 17.12
2020-06-04 17:56:54 +02:00
holivier d79d7c50b8 Improvement: Help link using asciidoc files via generated html (OFBIZ-11693)
1. Add a general property: userDocUri containing uri for
ofbiz.apache.org html user-documentation generated by Buildbot
2. in each theme, add a test on helpAnchor field, if it's define help
link is now on ${userDocUri}#${helpAnchor}
  * if userDocUri is not defined, the general property is used
2020-06-04 17:42:23 +02:00
Suraj Khurana e92becb0fd Improved: Enforce noninstantiability to ServiceGroupReader Class. (#177)
(OFBIZ-11750)
Made class as final, added private constructor and corrected private data member name as per naming convention.
2020-06-04 14:38:22 +05:30
Suraj Khurana 65c235704c Improved: Enforce noninstantiability to JobUtil Class. (#176)
(OFBIZ-11749)
Made class as final and added private constructor.
2020-06-03 16:08:49 +05:30
Suraj Khurana 9423bfdcc5 Improved: Enforce noninstantiability to ExpressionUiHelper Class. (#173)
(OFBIZ-11748)

Made class as final, added private constructor and corrected private data member naming convention.
2020-06-03 16:05:30 +05:30
Pawan Verma 8cac7f1fc5 Fixed: startup-service does not work without runtime-data-id(OFBIZ-11668) 2020-06-02 17:25:16 +05:30
Jacques Le Roux 4b55e07505 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Fixes Javadoc issues
2020-06-01 07:52:59 +02:00
James Yong a5ab3961fa Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow expression in template location.
2020-05-31 23:31:49 +08:00
James Yong f85040ff04 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow expression in template location.
2020-05-31 17:42:42 +08:00
James Yong d1a22a6ba8 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Cleanup script cache when session ended
2020-05-30 14:32:38 +08:00
James Yong c0e527efb2 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow external scripts within the multi-block html template, to be rendered
within the html head tag, when a new attribute data-import is set to “head”

Thanks: Jacques for review
2020-05-30 12:00:21 +08:00
Nicolas Malin 1558f232c2 Fixed: Remove unnecessary semi-column 2020-05-29 16:29:32 +02:00
holivier 1f673804a4 Improved: put simple-method optional for compound file (OFBIZ-11645) 2020-05-29 11:54:50 +02:00
holivier 097db39ee0 fixed: sort-order (field) not works in CompoundWidgets file (OFBIZ-11708)
In a form, when <sort-order tag is used, the children analyze not works
because, getTagName() is used not the getLocalName(). getTagName()
return "wf:sort-field" when getLocalName return "sort-field".
So change getTagName() to getLocalName() for sort-order children
2020-05-29 11:43:58 +02:00
holivier e4ee439e27 Fixed: drop-down field not work when in a compound-widget file (OFBIZ-11676)
When, in ModelFormField, FieldInfoWithOptions (which read xml file ) is
call, test on tag name is done with getName() and not getLocalName() so
none "option" is recognize when field is declare on a compound-widget
file. getName() is change to getLocalName()
2020-05-29 11:26:40 +02:00
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux 10b8acd5d1 Improved: removes useless "@deprecated No replacement" comments in Java code
This follows a discussion on dev ML 5 days ago.
Those comments are useless because they are all related to Minilang and Minilang
is deprecated as a whole.
2020-05-27 09:26:56 +02:00
Pierre Smits 5fac98022e Improved: quote menu
(OFBIZ-11715)

updated: QuoteTabBar - simplified labels
updated: moved 'Edit quote' menu item to QuoteSubTabBar
updated: reordering of menu-items of QuoteTabBar
updated: various UiLabels used by menu-items in QuoteTabBar
2020-05-24 14:34:03 +02:00