Skip to content

Commit 49176ae

Browse files
committed
Merge branch 'main' into bugfix/update-search-property-factory-across-versions
2 parents 2dfb332 + 11e3b5a commit 49176ae

File tree

37 files changed

+333
-153
lines changed

37 files changed

+333
-153
lines changed

src/Umbraco.Cms.Integrations.Automation.Zapier/Umbraco.Cms.Integrations.Automation.Zapier.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;net50;net60;net70;net80</TargetFrameworks>
4+
<TargetFrameworks>net472;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
55
<Authors>Umbraco HQ</Authors>
66
<Company>Umbraco</Company>
77
<Title>Umbraco CMS Integrations: Automation - Zapier</Title>
@@ -19,25 +19,25 @@
1919
<PackageReference Include="UmbracoCms.Web" Version="8.14.0" />
2020
</ItemGroup>
2121

22-
<ItemGroup Condition="'$(TargetFramework)' == 'net50'">
22+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
2323
<PackageReference Include="Umbraco.Cms.Web.Website" version="[9.0.1,10)" />
2424
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[9.0.1,10)" />
2525
<PackageReference Include="Umbraco.Cms.Web.Common" version="[9.0.1,10)" />
2626
</ItemGroup>
2727

28-
<ItemGroup Condition="'$(TargetFramework)' == 'net60'">
28+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
2929
<PackageReference Include="Umbraco.Cms.Web.Website" version="[10.0.0,11)" />
3030
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[10.0.0,11)" />
3131
<PackageReference Include="Umbraco.Cms.Web.Common" version="[10.0.0,11)" />
3232
</ItemGroup>
3333

34-
<ItemGroup Condition="'$(TargetFramework)' == 'net70'">
34+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
3535
<PackageReference Include="Umbraco.Cms.Web.Website" version="[11.0.0,13)" />
3636
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[11.0.0,13)" />
3737
<PackageReference Include="Umbraco.Cms.Web.Common" version="[11.0.0,13)" />
3838
</ItemGroup>
3939

40-
<ItemGroup Condition="'$(TargetFramework)' == 'net80'">
40+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
4141
<PackageReference Include="Umbraco.Cms.Web.Website" version="[13.0.0,14)" />
4242
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[13.0.0,14)" />
4343
<PackageReference Include="Umbraco.Cms.Web.Common" version="[13.0.0,14)" />

src/Umbraco.Cms.Integrations.Commerce.Shopify/App_Plugins/UmbracoCms.Integrations/Commerce/Shopify/js/productPickerSettings.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262

6363
function validateOAuthSetup() {
6464
umbracoCmsIntegrationsCommerceShopifyResource.validateAccessToken().then(function (response) {
65-
6665
vm.oauthSetup = {
67-
isConnected: response.isValid,
66+
isValid: response.isValid,
67+
isConnected: response.isConnected,
6868
isAccessTokenExpired: response.isExpired,
69-
isAccessTokenValid: response.isValid
69+
isAccessTokenValid: response.isConnected
7070
}
7171

7272
if (vm.oauthSetup.isConnected === true && vm.oauthSetup.isAccessTokenValid === true) {

src/Umbraco.Cms.Integrations.Commerce.Shopify/Controllers/ProductsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ProductsController(IShopifyService apiService, AuthorizationImplementatio
5050
}
5151

5252
[HttpGet]
53-
public EditorSettings CheckConfiguration() => _apiService.GetApiConfiguration();
53+
public async Task<EditorSettings> CheckConfiguration() => await _apiService.GetApiConfiguration();
5454

5555
[HttpGet]
5656
public string GetAuthorizationUrl() => _authorizationService.GetAuthorizationUrl();

src/Umbraco.Cms.Integrations.Commerce.Shopify/Editors/ShopifyProductPickerValueConverter.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public override object ConvertSourceToIntermediate(IPublishedElement owner, IPub
3838
if (source == null) return null;
3939

4040
return source.ToString()
41-
.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
41+
.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
4242
.Select(long.Parse)
4343
.ToArray();
4444
}
@@ -60,7 +60,21 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
6060
Id = p.Id,
6161
Title = p.Title,
6262
Body = p.Body,
63-
Image = p.Image?.Src
63+
ProductImage = p.Image != null ? new ProductImageViewModel { Src = p.Image.Src, Alt = p.Image.Alt } : null,
64+
Tags = p.Tags,
65+
ProductType = p.ProductType,
66+
PublishedScope = p.PublishedScope,
67+
Handle = p.Handle,
68+
Status = p.Status,
69+
Variants = from v in p.Variants
70+
select new VariantViewModel
71+
{
72+
InventoryQuantity = v.InventoryQuantity,
73+
Position = v.Position,
74+
Price = v.Price,
75+
Sku = v.Sku,
76+
Taxable = v.Taxable
77+
}
6478
};
6579

6680
return products.ToList();

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/Dtos/ProductDto.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using System.Collections.Generic;
2-
3-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
43

54
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Models.Dtos
65
{
@@ -29,6 +28,15 @@ public class ProductDto
2928

3029
[JsonProperty("image")]
3130
public ProductImageDto Image { get; set; }
31+
32+
[JsonProperty("product_type")]
33+
public string ProductType { get; set; }
34+
35+
[JsonProperty("published_scope")]
36+
public string PublishedScope { get; set; }
37+
38+
[JsonProperty("handle")]
39+
public string Handle { get; set; }
3240
}
3341

3442

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/Dtos/ProductImageDto.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ public class ProductImageDto
66
{
77
[JsonProperty("src")]
88
public string Src { get; set; }
9+
10+
[JsonProperty("alt")]
11+
public string Alt { get; set; }
912
}
1013
}

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/Dtos/ProductVariantDto.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ public class ProductVariantDto
1818

1919
[JsonProperty("inventory_quantity")]
2020
public int InventoryQuantity { get; set; }
21+
22+
[JsonProperty("taxable")]
23+
public bool Taxable { get; set; }
24+
2125
}
2226
}

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/EditorSettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public EditorSettings()
1212
[JsonProperty("isValid")]
1313
public bool IsValid { get; set; }
1414

15+
[JsonProperty("isConnected")]
16+
public bool IsConnected { get; set; }
17+
1518
[JsonProperty("type")]
1619
public ConfigurationType Type { get; set; }
1720
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels
2+
{
3+
public class ProductImageViewModel
4+
{
5+
public string Src { get; set; }
6+
public string Alt { get; set; }
7+
}
8+
}
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11

2+
using System.Collections.Generic;
3+
24
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels
35
{
46
public class ProductViewModel
57
{
68
public long Id { get; set; }
7-
89
public string Title { get; set; }
9-
1010
public string Body { get; set; }
1111

12-
public string Image { get; set; }
12+
public string Image => ProductImage.Src;
13+
public ProductImageViewModel ProductImage { get; set; }
14+
public string ProductType { get; set; }
15+
public string Tags { get; set; }
16+
public string Status { get; set; }
17+
public string PublishedScope { get; set; }
18+
public string Handle { get; set; }
19+
public IEnumerable<VariantViewModel> Variants { get; set; }
1320
}
1421
}

0 commit comments

Comments
 (0)