Skip to content

Conversation

@peaxe
Copy link
Contributor

@peaxe peaxe commented Jul 26, 2024

If you are hosting your site in Umbraco Cloud and using Visual Studio then you will have to make sure that the file/files (or parent folder of the files) you include will be configured in certain way in the .Web project configuration file. This is to ensure that the Umbraco Cloud site will be able to use the file/files.

Description

What did you add/update/change?

Type of suggestion

  • Typo/grammar fix
  • Updated outdated content
  • [x ] New content
  • Updates related to a new version
  • Other

Product & version (if relevant)

Umbraco 13 but possibly from Umbraco 10 to Umbraco 14

Deadline (if relevant)

When should the content be published?

If you are hosting your site in Umbraco Cloud and using Visual Studio then you will have to make sure that the file/files (or parent folder of the files) you include will be configured in certain way in the .Web project configuration file. This is to ensure that the Umbraco Cloud site will be able to use the file/files.
@peaxe
Copy link
Contributor Author

peaxe commented Jul 26, 2024

Not sure why the ReviewDog service failed its checks. 🤔
Just let me know if I need to make any changes from my side of the commited suggestion.

@peaxe
Copy link
Contributor Author

peaxe commented Jul 26, 2024

Nvm the ReviewDog did tell me why it did not approve.
I will follow the suggestion from this smart dog. 🐶 😸

Making the sentence shorter.
@eshanrnh
Copy link
Contributor

Thanks for the PR, @peaxe 🙌 We will review it as soon as we can 💪

@mattbrailsford
Copy link
Contributor

mattbrailsford commented Jul 29, 2024

I'm not entirely sure why this is necessary. There isn't anything in the default cloud .gitignore that would be preventing app_plugin files from being deployed so I'm not sure why you would need to force visual studio to output your files.

Can you explain more about your specific project structure? And what issue you were seeing if this settings wasn't present?

@peaxe
Copy link
Contributor Author

peaxe commented Jul 29, 2024

Hi @mattbrailsford

Thank you for taking time to review this.

Let me include the question to Umbraco Support and their answer that lead me to think that perhaps it is a good thing to include this information in the docs to cater the scenario when working with an Umbraco Cloud project in Visual Studio and adding json config files under App_Plugins.

The question I sent to Umbraco Support

Hi Support stars.

Background:
I have added this config-file sva13.Web\app_plugins\umbracocommerce\config\order.editor.config.json to my project in my local environment.
(According to these instructions: https://docs.umbraco.com/umbraco-commerce/v/13.commerce.latest-lts/key-concepts/ui-config-files#additional-info-config-options )

image

And in my local environment it displays a few extra properties in Backoffice that are connected to my (Umbraco Commerce) order.

image

So far so good. (In my local environment that is.)

Not working in the Umbraco Cloud Development environment
Bur when I deployed those changes to the Umbraco Cloud Development environment. Those neat extra properties do not show up in the Umbraco Cloud Develop Backoffice.

I can see that the file changes came through to the repository with kudu:

image

But there is no file in the C:\home\site\wwwroot\App_Plugins
(No UmbracoCommerce folder under it thus no config folder thus no config file.)

image
I have restarted the Umbraco Cloud Development environment but the file is still not showing up under C:\home\site\wwwroot\App_Plugins\UmbracoCommerce\config\order.editor.config.json

Question:
What may I (or we) do so the Umbraco Cloud Development environment may get this config file order.editor.config.json added under C:\home\site\wwwroot\App_Plugins\UmbracoCommerce\config\order.editor.config.json ?

I suppose it is due to the lack of this file that I will not get those custom properties displayed in Backoffice of the Umbraco Cloud Development environment. If this conclussion is wrong I'm gladly corrected with information that leads to the extra properties beind displayed. 😊

KR
Per

The answer I got from Umbraco Support

Hi Per,

I'm glad you reached out about this 😁

I believe it's related to Umbraco Cloud and this specific issue umbraco/Umbraco-CMS#12572 (comment) that is causing this, nothing related to Umbraco Commerce.

So what I'd suggest moving forward is trying to add this to your .csproj locally then push it up to the development environment.

<ItemGroup>
<Content Include="App_Plugins\**" CopyToOutputDirectory="Always" />
</ItemGroup>

This should allow the copy of the file in the App_Plugins.

Could you give it a try and let me know how it goes?

Best regards,

Sergiu.

@mattbrailsford
Copy link
Contributor

mattbrailsford commented Jul 29, 2024

Hmm, based upon the comments in the linked issue, wouldn't it just make more sense that the app_plugins folder be located inside the wwwroot and then non of these project file changes would be necesarry?

If this is the case, then I'd be tempted to just update one line in the docs under the heading Assigning a UI Config File to a Store change the path where configs are looked for from App_Plugins/UmbracoCommerce/config to wwwroot/App_Plugins/UmbracoCommerce/config

@peaxe
Copy link
Contributor Author

peaxe commented Jul 29, 2024

Perhaps I'm comparing apples and pears.
Kevin Jump's comment in this thread made me believe that similar files should live under the /App_Plugins folder rather than under the /wwwroot folder where they should end up as a step in the deploy.

Then again I might have misunderstood the advice from that comment. 😊

If the action you suggest is considered as best practice, then sure that advice sounds good and I'm glad if the docs contains that advice.

@mattbrailsford
Copy link
Contributor

mattbrailsford commented Jul 29, 2024

Thanks @peaxe

I get where Kevin is coming from here, and if I were developing an actual app plugin, then yea, I'd probably follow his advice, but given you aren't creating a plugin, you simple have a static config file that you want to make available, the simplest thing here would be for it to live directly in the wwwroot folder. This way it's instantly available, and doesn't require any special build steps.

@peaxe
Copy link
Contributor Author

peaxe commented Jul 29, 2024

Thank you @mattbrailsford for having the patience to sort this one out with me. And making me understand things better.
The outcome is that the docs will include this information that will help developers.

I totally agree with you that the advice can be simplified into: put the config files in the folder of:
wwwroot/App_Plugins/UmbracoCommerce/config

@mattbrailsford
Copy link
Contributor

No problem at all @peaxe I'm sorry this has been as big a source of confusion as it has for you. I'm just thankful for your submission so we can improve the docs to try and make sure other don't face the same 🙏

Update thanks to the feedback from @mattbrailsford
@peaxe
Copy link
Contributor Author

peaxe commented Jul 29, 2024

There: I (hopefully 😸 ) made the update you suggested @mattbrailsford
Once more thank you for this feedback! 🙌

@mattbrailsford
Copy link
Contributor

Yup, PR looks good to me.

Thanks again for the PR, it's very much appreciated. And the best of luck with the rest of the project.

@sofietoft
Copy link
Contributor

Thanks for the helping reviewing here @mattbrailsford ! 💪

And thanks again @peaxe , for help keeping our docs up to speed 😄
I'll get this merged right away!

@sofietoft sofietoft merged commit 9209831 into umbraco:main Jul 30, 2024
@peaxe peaxe deleted the patch-2 branch July 30, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants