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

MC custom application: Permission problem after migration app to @commercetools-frontend/* v21 #2644

Closed
cb-adesso opened this issue Jun 15, 2022 · 3 comments

Comments

@cb-adesso
Copy link

Hello Support,

this is not bug request but more an migration support request. I'm currently using following guide https://docs.commercetools.com/custom-applications/migrating-from-project-level-custom-applications to migrate our custom application new required "Project-level Custom Applications". I'm mot sure how to proceed with my issue. Commercetools support adviced me to post here my issue.

Original ticket ID: SUPPORT-16848

General Information

  • We use Admin user or DEV user with all permission active.
  • Custom App is used for order managament task among other things.
  • Logic is handled by REST Microservice hosted in AWS

Migration Procress already done

  • uninstall old custom application
  • create custom application config
  • update dependencies in package.json
    ** We moved from @commercetools-frontend/* v18 to @commercetools-frontend/* v21
  • adjust custom-application-config.json
  • Update routes.js / constants.js in React as proposed by the guide

Current Problem

  • Custom Application crashes on access (open mc > click on > custom application > access denied permission not sufficient)
  • Icon and menu is visible
  • I changed value for entryPointUriPath in React, but 'access denied' turned only into 'crash error'.

Relevant JS & Config files

package.json.txt
custom-application-config.json.txt
routes.js.txt
constants.js.txt

Any help is appriciated.

Kind Regards,

Chris

@cb-adesso cb-adesso added the 🐛 Type: Bug Something isn't working label Jun 15, 2022
@Rhotimee
Copy link
Contributor

Hello @cb-adesso,

I noticed you're using a different entryPointUriPath between the custom-application-config.json and constants.js.

It seems you're using the project key instead of the actual entry point in your constants.js file, which is then used to compute the permissions you have in your routes.js file.

You would need to update your constants.js file to use the same entry point value you have configured in your custom-application-config.json file.

There are also some hints about how to reuse these values between those two files that can make it easier to avoid this kind of miss-configurations.
For instance, your config file could be a JS file instead of a JSON and then you could import the constant in it so you are sure both files use the same value.

You can read more about this in this section of the migration guide.

@CarlosCortizasCT CarlosCortizasCT added 📞 Type: Customer request and removed 🐛 Type: Bug Something isn't working labels Jun 16, 2022
@cb-adesso
Copy link
Author

Nice, using the correkt value for entryPointUriPath did resolve my permission problem.
Now the app is missing IntlProvider in react ancestry, but this look more like regular React errors.
I think I can handle it.

Thank You!

@Rhotimee
Copy link
Contributor

@cb-adesso, you can follow the suggestion in this comment to resolve the IntlProvider issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants