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

Improved: Invoice Payments for user with 'VIEW' permission (OFBIZ-12384) #344

Closed

Conversation

PierreSmits
Copy link
Member

renamed CreateApplicationList.groovy to InvoicePayments.groovy
adjusted reference in acc-invoices.adoc regarding invoice payments
renamed HELP_editInvoiceApplications.adoc to HELP_invoicePayments.adoc

AccountingMenus.xml:

  • changed menu-item for invoice payments (name and label and link for better perception alignment)
    InvoiceScreens.xml:
    re screen InvoiceOverview
  • removed redundant property-map references
  • adjusted groovy script reference to new file name.
  • removed link definitions in screenlets (duplicate of menu-items related to the invoice)
  • adjusted references to invoice payment definitions in InvoiceForms.xml for better perception alignment
    re screen for invoice payment
  • renamed screen from 'InvoiceApplication' to 'InvoicePayments'
  • adjusted references to titleProperty, tabButtonItem and helpAnchor for better perception alignment
  • adjusted groovy script reference to new file name.
  • added conditions for CREATE and UPDATE permission to the start section
  • adjusted reference to the form (grid) to update existing invoice payments (for users with CREATE or UPDATE Permissions)
  • adjusted reference to the form (grid) for invoice payments (for users with CREATE or UPDATE Permissions)

InvoiceForms.xml

  • renamed 'ListInvoiceApplications' to 'InvoiceOverviewApplications. Changed from form definition to grid definition, adjusted field order.
  • renamed 'EditInvoiceApplications' to 'InvoicePayments' for user with VIEW permission. Changed from form definition to grid definition. adjusted field order.
  • added 'UpdateInvoicePayments for user with 'CREATE' or 'UPDATE' permissions.

controller.xml

  • adjusted requests related to invoice payments for better perception alignment
  • renamed view-map related to invoice payments for better perception alignment.

renamed CreateApplicationList.groovy to InvoicePayments.groovy
adjusted reference in acc-invoices.adoc regarding invoice payments
renamed HELP_editInvoiceApplications.adoc to HELP_invoicePayments.adoc

AccountingMenus.xml:
- changed menu-item for invoice payments (name and label and link for better perception alignment)
InvoiceScreens.xml:
re screen InvoiceOverview
- removed redundant property-map references
- adjusted groovy script reference to new file name.
- removed link definitions in screenlets (duplicate of menu-items related to the invoice)
- adjusted references to invoice payment definitions in InvoiceForms.xml for better perception alignment
re screen for invoice payment
- renamed screen from 'InvoiceApplication' to 'InvoicePayments'
- adjusted references to titleProperty, tabButtonItem and helpAnchor for better perception alignment
- adjusted groovy script reference to new file name.
- added conditions for CREATE and UPDATE permission to the start section
- adjusted reference to the form (grid) to update existing invoice payments (for users with CREATE or UPDATE Permissions)
- adjusted reference to the form (grid) for invoice payments (for users with CREATE or UPDATE Permissions)

InvoiceForms.xml
- renamed 'ListInvoiceApplications' to 'InvoiceOverviewApplications. Changed from form definition to grid definition, adjusted field order.
- renamed 'EditInvoiceApplications' to 'InvoicePayments' for user with VIEW permission. Changed from form definition to grid definition. adjusted field order.
- added 'UpdateInvoicePayments for user with 'CREATE' or 'UPDATE' permissions.

controller.xml
- adjusted requests related to invoice payments for better perception alignment
- renamed view-map related to invoice payments for better perception alignment.
* trunk:
  Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
  Improved: Try to reduce the SARIF file used by CodeQL for Java classes (OFBIZ-12361)
  Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
@sonarcloud
Copy link

sonarcloud bot commented Nov 17, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mbrohl
Copy link
Contributor

mbrohl commented Nov 17, 2021

This change does not only fix the issue but also introduces various name changes, also for requests which possibly breaks custom uses. Please provide a PR which only fixes the issue and maybe another one for proposed improvements or name changes. Thanks.

@mbrohl
Copy link
Contributor

mbrohl commented Nov 17, 2021

Also, please avoid merge commits, you can better update your personal repository using a rebase.

@PierreSmits
Copy link
Member Author

PierreSmits commented Nov 17, 2021

Please list for each offence:

  1. what the violation is, and
  2. which rule it violates against

@PierreSmits
Copy link
Member Author

Please list every custom code it breaks.
You might have forgotten, but in the comments at the top of each file is stated: 'software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied'.

That makes that the project, nor the contributor can be held accountable for custom code (in a downstream repository, or implementation).

@PierreSmits
Copy link
Member Author

Also, please avoid merge commits, you can better update your personal repository using a rebase.

Thanks for the suggestion.

@mbrohl
Copy link
Contributor

mbrohl commented Nov 17, 2021

You missed my point. If you want to fix something which is broken, please do it solely in a PR and avoid to introduce additional changes. It's harder to test/review and also has more risks to introduce additional bugs if you mix it up with other changes.

Changes like name changes also have to be dicussed and reviewed diffrently from bug fixes. They should not slip in with a bug fix.

Thanks.

@PierreSmits
Copy link
Member Author

When talking about a bug fix, there is a (potential) validity. However, this is not the case.

@PierreSmits
Copy link
Member Author

PierreSmits commented Nov 17, 2021

I may not be up to date with latest 'rule' changes, but again: please state for each offence, which rule it violates and point out where that violated rule can be found.
If code (in trunk) gets broken by merging this PR, please point out each case.

I am, as I have been, always motivated to work with the community.

@mbrohl
Copy link
Contributor

mbrohl commented Nov 17, 2021

The description of the corresponding issue reads: "Currently, a user with only 'VIEW' permissions, as demonstrated in trunk demo with userId = auditor, accessing the payments screen on an invoice sees fields editable and triggers to requests reserved for users with 'CREATE' or 'UPDATE' permissions."

If you call it an improvement or bug (which I would call it), the description explains what should be fixed/improved.

The changes in this PR are a lot more than just fixing the permission bug decribed there.
I think I was clear enough and won't add more to this issue. I won't merge the PR as it is now.

@PierreSmits
Copy link
Member Author

PierreSmits commented Nov 17, 2021

Tak for pointing that out. I will change the subject of the ticket.
And will remove the description, if the community desires so.

@JacquesLeRoux
Copy link
Contributor

Quoting Michael

You missed my point. If you want to fix something which is broken, please do it solely in a PR and avoid to introduce additional changes. It's harder to test/review and also has more risks to introduce additional bugs if you mix it up with other changes.

Changes like name changes also have to be dicussed and reviewed diffrently from bug fixes. They should not slip in with a bug fix

Also it's often quite harder to revert...

@JacquesLeRoux
Copy link
Contributor

Pierre,

You need to refrain yourself to put unrelated changes into a sole PR. It complicates things for committers, TIA

@mbrohl
Copy link
Contributor

mbrohl commented Nov 17, 2021

Sounds a bit weird to now change the issue to match the PR instead of changing the PR to match the issue...
Anyway, you should give the community some good explanations WHY you want to do all those renames then. In the description.

@PierreSmits
Copy link
Member Author

Pierre,

You need to refrain yourself to put unrelated changes into a sole PR. It complicates things for committers, TIA

Thanks for the tip, Jacques.
But does the PR break anything in trunk?

@JacquesLeRoux
Copy link
Contributor

As I said in the Jira it works

@PierreSmits
Copy link
Member Author

PierreSmits commented Nov 17, 2021

Thanks Jacques.

If members of the community feels that there must be a rule for having each minor or trivial improvement to be raised as a separate ticket, and having its own PR, instead of being combined with another ticket (and the PR associated with that), they can of course start that discussion in dev. I believe that any new contributor would say that such processes would be overbearing, cumbersome and counter-productive.

Addressing those minor and trivial issues (even without their own tickets) in one go with other tickets (and even without), has been done by every contributor - non-privileged and others - in the past 15 years without raising eye-brows.

@JacquesLeRoux
Copy link
Contributor

It's simple, create sufficient PRs inside the same Jira to separate things . That's what most savvy contributors did for years, using patches before. Then it's easier for committers to:

  1. review
  2. validate (test, etc.)
  3. revert if necessary

If you don't do that you will always front what you seem to feel as negligence from committers. We just prefer an easier and especially safer work.

@JacquesLeRoux
Copy link
Contributor

Hi Pierre,

First I must say that in general it's not a good idea to edit comment sin GitHub. Because there is no history or way to compare once done, or I don't know how. Also I think that mixing comments in Jira and GH PR is not helping. Anyway, here is an answer to your last comment above.

You ask about rules, etc. You don't need rules here, just common sense. And it was clearly explained by Michael above. Not all can be ruled, and even with rules you need a judge. Michael and I were your judges here.

Though I wonder how for a "Proud contributor of Apache OFBiz since 2008 (without privileges)" you don't see what the problems are. You are lucky I'm in a good day.

Here are more details. If you feel cosmetic changes, like renaming things, should be done you should have made them in another PR. I mean changed/renamed AccountingUiLabels.xml, InvoicePayments.groovy, acc-invoices.adoc, HELP_invoicePayments.adoc, the controller.xml, AccountingMenus.xml , in another PR. Only InvoiceForms.xml and InvoiceScreens.xml should have be part of this PR but without renaming in them.

You remember 6727f46 ? That's what I want to avoid. Even if I must say it certainly has not the same extend here.

Also, I don't know if it's related to GitHub patches or how Eclipse apply patches. When using apply patch from clipboard in Eclipse to locally test, file renaming is not working. Maybe it's due to how you rename files and should read https://www.patrick-wied.at/blog/rename-files-and-folders-with-git or something alike?

That's what I get in cmd line after saving https://patch-diff.githubusercontent.com/raw/apache/ofbiz-framework/pull/344.patch locally.

C:\projectsASF\Git\ofbiz-framework>git apply --stat 344.patch
 .../accounting/config/AccountingUiLabels.xml       |    6 +-
 .../groovyScripts/invoice/InvoicePayments.groovy   |    0
 .../asciidoc/_include/HELP_invoicePayments.adoc    |    0
 .../src/docs/asciidoc/_include/acc-invoices.adoc   |    2 -
 .../webapp/accounting/WEB-INF/controller.xml       |   18 +++---
 applications/accounting/widget/AccountingMenus.xml |    4 +
 applications/accounting/widget/InvoiceForms.xml    |   42 +++++++++------
 applications/accounting/widget/InvoiceScreens.xml  |   57 +++++++-------------
 8 files changed, 61 insertions(+), 68 deletions(-)

C:\projectsASF\Git\ofbiz-framework>git apply --check 344.patch
error: patch failed: applications/accounting/config/AccountingUiLabels.xml:24357
error: applications/accounting/config/AccountingUiLabels.xml: patch does not apply
error: applications/accounting/groovyScripts/invoice/CreateApplicationList.groovy: No such file or directory
error: applications/accounting/src/docs/asciidoc/_include/HELP_editInvoiceApplications.adoc: No such file or directory
error: patch failed: applications/accounting/src/docs/asciidoc/_include/acc-invoices.adoc:56
error: applications/accounting/src/docs/asciidoc/_include/acc-invoices.adoc: patch does not apply
error: patch failed: applications/accounting/webapp/accounting/WEB-INF/controller.xml:213
error: applications/accounting/webapp/accounting/WEB-INF/controller.xml: patch does not apply
error: patch failed: applications/accounting/widget/AccountingMenus.xml:171
error: applications/accounting/widget/AccountingMenus.xml: patch does not apply
error: patch failed: applications/accounting/widget/InvoiceForms.xml:188
error: applications/accounting/widget/InvoiceForms.xml: patch does not apply
error: patch failed: applications/accounting/widget/InvoiceScreens.xml:182
error: applications/accounting/widget/InvoiceScreens.xml: patch does not apply

C:\projectsASF\Git\ofbiz-framework>git am 344.patch
error: patch failed: applications/accounting/config/AccountingUiLabels.xml:24357
error: applications/accounting/config/AccountingUiLabels.xml: patch does not apply
error: applications/accounting/groovyScripts/invoice/CreateApplicationList.groovy: does not exist in index
error: applications/accounting/src/docs/asciidoc/_include/HELP_editInvoiceApplications.adoc: does not exist in index
error: patch failed: applications/accounting/src/docs/asciidoc/_include/acc-invoices.adoc:56
error: applications/accounting/src/docs/asciidoc/_include/acc-invoices.adoc: patch does not apply
error: patch failed: applications/accounting/webapp/accounting/WEB-INF/controller.xml:213
error: applications/accounting/webapp/accounting/WEB-INF/controller.xml: patch does not apply
error: patch failed: applications/accounting/widget/AccountingMenus.xml:171
error: applications/accounting/widget/AccountingMenus.xml: patch does not apply
error: patch failed: applications/accounting/widget/InvoiceForms.xml:188
error: applications/accounting/widget/InvoiceForms.xml: patch does not apply
error: patch failed: applications/accounting/widget/InvoiceScreens.xml:182
error: applications/accounting/widget/InvoiceScreens.xml: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: Improved: Invoice Payments for user with 'VIEW' permission (OFBIZ-12384)
Patch failed at 0001 Improved: Invoice Payments for user with 'VIEW' permission (OFBIZ-12384)
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

So I can't test your changes locally and something must be done.

@PierreSmits PierreSmits closed this Dec 5, 2021
@PierreSmits PierreSmits deleted the OFBIZ-12384-Invoice-Payments branch December 5, 2021 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants