Skip to content

Commit

Permalink
Merge pull request #242 from umbraco/feature/v15/shopify-cache-level
Browse files Browse the repository at this point in the history
Update Shopify property editor cache level
  • Loading branch information
acoumb authored Jan 6, 2025
2 parents f5c0492 + 827b562 commit 6e70eac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Configuration
using Umbraco.Cms.Core.PropertyEditors;

namespace Umbraco.Cms.Integrations.Commerce.Shopify.Configuration
{
public class ShopifySettings
{
Expand All @@ -9,5 +11,7 @@ public class ShopifySettings
public string AccessToken { get; set; } = string.Empty;

public bool UseUmbracoAuthorization { get; set; } = true;

public PropertyCacheLevel PropertyCacheLevel { get; set; } = PropertyCacheLevel.Snapshot;
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
using System.Text.Json;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Integrations.Commerce.Shopify.Configuration;
using Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels;
using Umbraco.Cms.Integrations.Commerce.Shopify.Services;

namespace Umbraco.Cms.Integrations.Commerce.Shopify.Editors
{
public class ShopifyProductPickerValueConverter : PropertyValueConverterBase
{
private readonly ShopifySettings _settings;
private readonly IShopifyService _apiService;

public ShopifyProductPickerValueConverter(IShopifyService apiService)
public ShopifyProductPickerValueConverter(IOptions<ShopifySettings> options, IShopifyService apiService)
{
_settings = options.Value;
_apiService = apiService;
}

Expand All @@ -21,7 +24,7 @@ public override bool IsConverter(IPublishedPropertyType propertyType) =>
public override Type GetPropertyValueType(IPublishedPropertyType propertyType) => typeof(List<ProductViewModel>);

public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType) =>
PropertyCacheLevel.Snapshot;
_settings.PropertyCacheLevel;

public override object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, object source,
bool preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageIconUrl></PackageIconUrl>
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main-v14/src/Umbraco.Cms.Integrations.Commerce.Shopify</PackageProjectUrl>
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
<Version>3.0.0</Version>
<Version>3.1.0</Version>
<Authors>Umbraco HQ</Authors>
<Company>Umbraco</Company>
<PackageIcon>shopify.png</PackageIcon>
Expand Down

0 comments on commit 6e70eac

Please sign in to comment.