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

Update Shopify and Dynamics to exclude V8 rendering view. #243

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

acoumb
Copy link
Contributor

@acoumb acoumb commented Jan 29, 2025

Current PR addresses the issue raised with item #239 , for integrations that have a rendering view for Umbraco 8.

While running in production runtime mode, due to the V8 view, a compilation error occurs.

To address this, I've moved the rendering view to a different folder and excluded it during copy if the targeting framework is not .NET 4.7.2.

Copy link

@ronaldbarendse ronaldbarendse left a comment

Choose a reason for hiding this comment

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

Besides aligning the view paths for the different versions, make sure to test whether the views are still copied over on .NET Framework (this doesn't seem to be the case by just looking at the code)...

@@ -15,7 +15,7 @@ public static class Constants

public static class RenderingComponent
{
public const string DefaultV8ViewPath = AppPluginFolderPath + "/Render/Products.cshtml";
public const string DefaultV8ViewPath = AppPluginFolderPath + "/RenderV8/Products.cshtml";

public const string DefaultV9ViewPath = AppPluginFolderPath + "/Render/ProductsV9.cshtml";

Choose a reason for hiding this comment

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

Would it make sense to change this path to also have the version in the folder name?

Suggested change
public const string DefaultV9ViewPath = AppPluginFolderPath + "/Render/ProductsV9.cshtml";
public const string DefaultV9ViewPath = AppPluginFolderPath + "/RenderV9/Products.cshtml";

@@ -4,9 +4,10 @@
<ShopifyPropertyEditorFiles>$(MSBuildThisFileDirectory)..\App_Plugins\UmbracoCms.Integrations\Commerce\Shopify\**\*.*</ShopifyPropertyEditorFiles>
</PropertyGroup>

<Target Name="CopyShopifyPropertyEditorAssets" BeforeTargets="Build">
<Target Condition=" '$(TargetFramework)' != 'net472' " Name="CopyShopifyPropertyEditorAssets" BeforeTargets="Build">

Choose a reason for hiding this comment

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

Shouldn't this condition be on the ShopifyPropertyEditorFiles item group instead, since this target needs to run on both .NET Framework and modern .NET?

And instead of adding multiple includes/excludes, use this instead:

<ShopifyPropertyEditorFiles Include="$(ShopifyPropertyEditorFiles)" />
<ShopifyPropertyEditorFiles Condition="'$(TargetFramework)' != 'net472'" Remove="$(MSBuildThisFileDirectory)..\App_Plugins\UmbracoCms.Integrations\Commerce\Shopify\RenderV8\*.*" />
<ShopifyPropertyEditorFiles Condition="'$(TargetFramework)' == 'net472'" Remove="$(MSBuildThisFileDirectory)..\App_Plugins\UmbracoCms.Integrations\Commerce\Shopify\RenderV9\*.*" />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @ronaldbarendse , updated accordingly. On V8 it works fine.

@acoumb acoumb requested a review from ronaldbarendse January 30, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants