Skip to content

Commit b470c37

Browse files
committed
42083 V14: Integrations (Shopify)
- Remove redundant netcoreapp condition - re generate api
1 parent 1b5f8ea commit b470c37

File tree

8 files changed

+9
-69
lines changed

8 files changed

+9
-69
lines changed
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
using System.Collections.Generic;
22

3-
#if NETCOREAPP
43
using Microsoft.AspNetCore.Html;
54
using Microsoft.AspNetCore.Mvc.Rendering;
65
using Microsoft.AspNetCore.Mvc.ViewFeatures;
7-
#else
8-
using System.Web;
9-
using System.Web.Mvc;
10-
using System.Web.Mvc.Html;
11-
#endif
126

137
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Models.ViewModels;
148

159
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Core.Helpers
1610
{
1711
public static class ShopifyHtmlExtensions
1812
{
19-
#if NETCOREAPP
2013
public static IHtmlContent RenderShopifyProductsList(this IHtmlHelper<dynamic> htmlHelper, List<ProductViewModel> vm, string renderingViewPath = "")
2114
{
2215
return htmlHelper.Partial(string.IsNullOrEmpty(renderingViewPath) ? Constants.RenderingComponent.DefaultV9ViewPath : renderingViewPath, vm);
2316
}
24-
#else
25-
public static IHtmlString RenderShopifyProductsList(this HtmlHelper htmlHelper, List<ProductViewModel> vm, string renderingViewPath = "")
26-
{
27-
return htmlHelper.Partial(string.IsNullOrEmpty(renderingViewPath) ? Constants.RenderingComponent.DefaultV8ViewPath : renderingViewPath, vm);
28-
}
29-
#endif
3017
}
3118
}

src/Umbraco.Cms.Integrations.Commerce.Shopify.Core/Services/AuthorizationService.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if NETCOREAPP
2-
using Microsoft.Extensions.Options;
3-
#else
4-
using System.Configuration;
5-
#endif
1+
using Microsoft.Extensions.Options;
62

73
using System;
84
using System.Collections.Generic;
@@ -23,20 +19,11 @@ public class AuthorizationService : BaseAuthorizationService, IShopifyAuthorizat
2319

2420
private readonly ShopifyOAuthSettings _oauthSettings;
2521

26-
#if NETCOREAPP
2722
public AuthorizationService(IOptions<ShopifySettings> options, IOptions<ShopifyOAuthSettings> oauthSettings, ITokenService tokenService)
28-
#else
29-
public AuthorizationService(ITokenService tokenService)
30-
#endif
3123
: base(tokenService)
3224
{
33-
#if NETCOREAPP
3425
_settings = options.Value;
3526
_oauthSettings = oauthSettings.Value;
36-
#else
37-
_settings = new ShopifySettings(ConfigurationManager.AppSettings);
38-
_oauthSettings = new ShopifyOAuthSettings(ConfigurationManager.AppSettings);
39-
#endif
4027
}
4128

4229
public string GetAccessToken(string code) =>

src/Umbraco.Cms.Integrations.Commerce.Shopify.Core/Services/CacheHelper.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
using System;
2-
32
using Newtonsoft.Json;
4-
5-
#if NETCOREAPP
63
using Umbraco.Cms.Core.Cache;
74
using Umbraco.Extensions;
8-
#else
9-
using Umbraco.Core.Cache;
10-
#endif
115

126

137
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Core.Services

src/Umbraco.Cms.Integrations.Commerce.Shopify.Core/Services/ShopifyService.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Net;
44
using System.Net.Http;
55
using System.Threading.Tasks;
6-
76
using Newtonsoft.Json;
87
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Configuration;
98
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Models;
@@ -14,20 +13,9 @@
1413
using System.Linq;
1514
using System.Web;
1615
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Helpers;
17-
18-
19-
20-
21-
22-
#if NETCOREAPP
2316
using Microsoft.Extensions.Logging;
2417
using Microsoft.Extensions.Options;
2518
using ShopifyLogLevel = Umbraco.Cms.Core.Logging.LogLevel;
26-
#else
27-
using System.Configuration;
28-
using Umbraco.Core.Logging;
29-
using ShopifyLogLevel = Umbraco.Core.Logging.LogLevel;
30-
#endif
3119

3220
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Core.Services
3321
{

src/Umbraco.Cms.Integrations.Commerce.Shopify.Core/Services/TokenService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#if NETCOREAPP
2-
using Umbraco.Cms.Core.Services;
3-
#else
4-
using Umbraco.Core.Services;
5-
#endif
1+
using Umbraco.Cms.Core.Services;
62

73
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Core.Services
84
{

src/Umbraco.Cms.Integrations.Commerce.Shopify.Core/Services/UmbracoAuthorizationService.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
using Newtonsoft.Json;
2-
32
using System;
43
using System.Collections.Generic;
54
using System.Net.Http;
65
using System.Net;
76
using System.Threading.Tasks;
8-
97
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Configuration;
108
using Umbraco.Cms.Integrations.Commerce.Shopify.Core.Models.Dtos;
11-
12-
#if NETCOREAPP
139
using Microsoft.Extensions.Options;
14-
#else
15-
using System.Configuration;
16-
#endif
1710

1811
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Core.Services
1912
{
@@ -27,25 +20,16 @@ public class UmbracoAuthorizationService : BaseAuthorizationService, IShopifyAut
2720

2821
public const string ServiceAddressReplace = "service_address_shop-replace";
2922

30-
public const string OAuthProxyBaseUrl = "https://localhost:44340/"; // for local testing: "https://localhost:44364/";
23+
public const string OAuthProxyBaseUrl = "https://hubspot-forms-auth.umbraco.com/"; // for local testing: "https://localhost:44364/";
3124

3225
public const string OAuthProxyRedirectUrl = OAuthProxyBaseUrl + "oauth/shopify";
3326

3427
public const string OAuthProxyTokenUrl = OAuthProxyBaseUrl + "oauth/v1/token";
35-
36-
#if NETCOREAPP
3728
public UmbracoAuthorizationService(IOptions<ShopifySettings> options, ITokenService tokenService)
3829
: base(tokenService)
3930
{
4031
_settings = options.Value;
4132
}
42-
#else
43-
public UmbracoAuthorizationService(ITokenService tokenService)
44-
: base(tokenService)
45-
{
46-
_settings = new ShopifySettings(ConfigurationManager.AppSettings);
47-
}
48-
#endif
4933

5034
public string GetAccessToken(string code) =>
5135
GetAccessTokenAsync(code).ConfigureAwait(false).GetAwaiter().GetResult();

src/Umbraco.Cms.Integrations.Commerce.Shopify/Client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Umbraco.Cms.Integrations.Testsite.V14/Umbraco.Cms.Integrations.Testsite.V14.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
1818
</ItemGroup>
1919

20+
<ItemGroup>
21+
<Folder Include="wwwroot\" />
22+
</ItemGroup>
23+
2024
<PropertyGroup>
2125
<!-- Razor files are needed for the backoffice to work correctly -->
2226
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>

0 commit comments

Comments
 (0)