Skip to content

Fixed Issue #14633 Sub-admin role related issue in order view page in magento 2 admin #30001

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

Merged

Conversation

hws47a
Copy link
Contributor

@hws47a hws47a commented Sep 11, 2020

This PR is replacing #20903 with some code style fixes and improvements.

*All further description is copy-pasted from the previous PR

Description (*)

Fixed Issue #14633 Sub-admin role related issue in order view page in magento 2 admin

Fixed Issues (if relevant)

  1. Fixes Sub-admin role related issue in order view page in magento 2 admin #14633: Sub-admin role related issue in order view page in magento 2 admin
  2. ...

Manual testing scenarios (*)

I have created one sub admin user from Magento admin. This user can only view orders, add a comment and operate on shipping. I gave some permissions for sub admin user. Please check the below image:
screenshotacl

So as you can see I have disabled Invoice and Credit memo role of this sub-admin.
But when I logged in as sub admin and go to order view page.Sometime Pop will come with "Something Went Wrong" and sometimes js error comes in console

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Govind Sharma and others added 3 commits February 22, 2019 19:16
Update Creditmemos.php

Update Shipments.php

Update Creditmemos.php

Update Invoices.php

Update Invoices.php

Update Creditmemos.php

Update Shipments.php

Update Creditmemos.php

Update Invoices.php

Update Creditmemos.php

Update Creditmemos.php

Made Requested Changes
@m2-assistant
Copy link

m2-assistant bot commented Sep 11, 2020

Hi @hws47a. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@hws47a hws47a requested a review from sivaschenko September 11, 2020 12:02
@ihor-sviziev ihor-sviziev self-assigned this Sep 11, 2020
@ihor-sviziev ihor-sviziev added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Sep 11, 2020
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hws47a,
In general your changes looks good to me. Could you cover your changes with some type of tests?

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@hws47a
Copy link
Contributor Author

hws47a commented Sep 11, 2020

@ihor-sviziev I have no problems writing unit tests for this. However, it'll have pretty limited value for this case.

MFTF tests will be more appropriate in this case, but not sure if'll have enough energy and time for that 🙂

@ihor-sviziev
Copy link
Contributor

@hws47a I think there will be suitable mftf or integration tests. Please try to write tests, if you'll have any issues - we'll try to help you

@sidolov sidolov added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Sep 11, 2020
@engcom-Charlie engcom-Charlie self-assigned this Sep 14, 2020
@ghost ghost assigned hws47a Sep 14, 2020
@ihor-sviziev
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hws47a,
About the test results:

  • SVC - ✔seems like false positive, reported an issue for that magento/magento-semver#50
  • functional tests - ✔seems like not related to changes from this PR.
  • static tests - ❌ could you fix these failures? Unfortunately we need to make changed files to pass static test, even if before
    changing they weren't.

Could you also cover your changes with MFTF test(s)?

@hws47a
Copy link
Contributor Author

hws47a commented Sep 16, 2020

@ihor-sviziev thanks for your checks.
I'll fix code styles today.
For MFTF I need some time to re-configure the local environment to make tests work, so probably need a few more days.

@ihor-sviziev
Copy link
Contributor

@hws47a if you don't have env for running and writing MFTF tests I would recommend you https://warden.dev/, there is quite good and clear docs.

@engcom-Bravo engcom-Bravo added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Oct 19, 2020
@ghost ghost dismissed ihor-sviziev’s stale review October 20, 2020 07:06

Pull Request state was updated. Re-review required.

@engcom-Charlie
Copy link
Contributor

It needs to approve, SVC falls with errors:

  • Magento\Sales\Block\Adminhtml\Order\View\Tab\Shipments::getOrder [public] Method return typing changed.
  • Magento\Sales\Block\Adminhtml\Order\View\Tab\Creditmemos::__construct [public] Method has been added.
  • Magento\Sales\Block\Adminhtml\Order\View\Tab\Invoices::__construct [public] Method has been added.

@hws47a
Copy link
Contributor Author

hws47a commented Feb 18, 2021

@engcom-Charlie @sidolov should it be closed?

@sivaschenko
Copy link
Member

@magento run Semantic Version Checker

@sivaschenko
Copy link
Member

Approval Request: https://jira.corp.magento.com/browse/MC-41920
Can be merged after the approval request is completed

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-8351 has been created to process this Pull Request

@sivaschenko
Copy link
Member

The SVC failure is approved

magento-engcom-team pushed a commit that referenced this pull request Aug 20, 2021
@magento-engcom-team magento-engcom-team merged commit 431d1bb into magento:2.4-develop Aug 20, 2021
@m2-assistant
Copy link

m2-assistant bot commented Aug 20, 2021

Hi @hws47a, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Sales Partner: Monsoon partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub-admin role related issue in order view page in magento 2 admin
8 participants