Skip to content

Commit ff13377

Browse files
committed
Merge branch 'main' into feature/inriver-integration
# Conflicts: # src/Umbraco.Cms.Integrations.sln
2 parents 45a90be + 3aacc11 commit ff13377

34 files changed

+330
-154
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
trigger:
2+
- main
3+
4+
pool:
5+
vmImage: 'windows-latest'
6+
7+
variables:
8+
projectName: 'Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core'
9+
project: 'src/$(projectName)/$(projectName).csproj'
10+
buildPlatform: 'Any CPU'
11+
buildConfiguration: 'Release'
12+
13+
steps:
14+
- task: NuGetToolInstaller@1
15+
displayName: 'Install NuGet'
16+
17+
- task: DotNetCoreCLI@2
18+
displayName: 'NuGet Restore'
19+
inputs:
20+
command: 'restore'
21+
feedsToUse: 'select'
22+
projects: '$(project)'
23+
includeNuGetOrg: true
24+
25+
- task: VSBuild@1
26+
displayName: 'Build Project'
27+
inputs:
28+
solution: '$(project)'
29+
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
30+
platform: '$(buildPlatform)'
31+
configuration: '$(buildConfiguration)'
32+
33+
- task: DotNetCoreCLI@2
34+
displayName: 'Create NuGet Package'
35+
inputs:
36+
command: 'pack'
37+
arguments: '--configuration $(buildConfiguration)'
38+
packagesToPack: '$(project)'
39+
versioningScheme: 'off'
40+
41+
- task: PublishBuildArtifacts@1
42+
displayName: 'Publish Build Artifacts'
43+
inputs:
44+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
45+
ArtifactName: 'drop'
46+
publishLocation: 'Container'

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/ActiveCampaignComposer.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/ActiveCampaignComposer.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using Microsoft.Extensions.DependencyInjection;
22

3+
using System;
4+
35
using Umbraco.Cms.Core.Composing;
46
using Umbraco.Cms.Core.DependencyInjection;
5-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Configuration;
7+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Configuration;
68

7-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign
9+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core
810
{
911
public class ActiveCampaignComposer : IComposer
1012
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/ActiveCampaignFormPickerConfiguration.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/ActiveCampaignFormPickerConfiguration.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Umbraco.Cms.Core.PropertyEditors;
22

3-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign
3+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core
44
{
55
public class ActiveCampaignFormPickerConfiguration
66
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/ActiveCampaignFormPickerConfigurationEditor.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/ActiveCampaignFormPickerConfigurationEditor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Umbraco.Cms.Core.PropertyEditors;
33
using Umbraco.Cms.Core.Services;
44

5-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign
5+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core
66
{
77
public class ActiveCampaignFormPickerConfigurationEditor : ConfigurationEditor<ActiveCampaignFormPickerConfiguration>
88
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/ActiveCampaignFormPickerPropertyEditor.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/ActiveCampaignFormPickerPropertyEditor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
using Umbraco.Cms.Core.PropertyEditors;
33
using Umbraco.Cms.Core.Services;
44

5-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign
5+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core
66
{
77
[DataEditor(
88
alias: Constants.PropertyEditorAlias,
99
name: "ActiveCampaign Form Picker",
1010
view: "~/App_Plugins/UmbracoCms.Integrations/Crm/ActiveCampaign/views/formpicker.html",
11-
Group = Core.Constants.PropertyEditors.Groups.Pickers,
11+
Group = Cms.Core.Constants.PropertyEditors.Groups.Pickers,
1212
Icon = "icon-activecampaign")]
1313
public class ActiveCampaignFormPickerPropertyEditor : DataEditor
1414
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Configuration/ActiveCampaignSettings.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Configuration/ActiveCampaignSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Configuration
2+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Configuration
33
{
44
public class ActiveCampaignSettings
55
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Constants.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Constants.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign
2+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core
33
{
44
public class Constants
55
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Controllers/FormsController.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Controllers/FormsController.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.Extensions.Options;
33

4+
using System;
5+
using System.Net.Http;
46
using System.Text.Json;
57
using System.Text.Json.Nodes;
8+
using System.Threading.Tasks;
69

7-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Configuration;
8-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos;
10+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Configuration;
11+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos;
912
using Umbraco.Cms.Web.BackOffice.Controllers;
1013
using Umbraco.Cms.Web.Common.Attributes;
1114

12-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Controllers
15+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Controllers
1316
{
1417
[PluginController("UmbracoCmsIntegrationsCrmActiveCampaign")]
1518
public class FormsController : UmbracoAuthorizedApiController

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Editors/ActiveCampaignFormPickerValueConverter.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Editors/ActiveCampaignFormPickerValueConverter.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using Microsoft.Extensions.Options;
2-
using System.Text.Json.Nodes;
2+
3+
using System;
34

45
using Umbraco.Cms.Core.Models.PublishedContent;
56
using Umbraco.Cms.Core.PropertyEditors;
6-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Configuration;
7-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.ViewModels;
7+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Configuration;
8+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.ViewModels;
89

9-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Editors
10+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Editors
1011
{
1112
public class ActiveCampaignFormPickerValueConverter : PropertyValueConverterBase
1213
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Helpers/ActiveCampaignHtmlExtensions.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Helpers/ActiveCampaignHtmlExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.AspNetCore.Html;
22
using Microsoft.AspNetCore.Mvc.Rendering;
33

4-
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.ViewModels;
4+
using Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.ViewModels;
55

66
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Helpers
77
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/Dtos/ApiAccessDto.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/Dtos/ApiAccessDto.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos
2+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos
33
{
44
public class ApiAccessDto
55
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/Dtos/BaseResponseDto.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/Dtos/BaseResponseDto.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Text.Json.Serialization;
22

3-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos
3+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos
44
{
55
public abstract class BaseResponseDto
66
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/Dtos/FormCollectionResponseDto.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/Dtos/FormCollectionResponseDto.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using System.Text.Json.Serialization;
1+
using System.Collections.Generic;
2+
using System.Text.Json.Serialization;
23

3-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos
4+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos
45
{
56
public class FormCollectionResponseDto : BaseResponseDto
67
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/Dtos/FormDto.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/Dtos/FormDto.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Text.Json.Serialization;
22

3-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos
3+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos
44
{
55
public class FormDto
66
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/Dtos/FormResponseDto.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/Dtos/FormResponseDto.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Text.Json.Serialization;
22

3-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.Dtos
3+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.Dtos
44
{
55
public class FormResponseDto : BaseResponseDto
66
{

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Models/ViewModels/FormViewModel.cs renamed to src/Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core/Models/ViewModels/FormViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Models.ViewModels
2+
namespace Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.Models.ViewModels
33
{
44
public class FormViewModel
55
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net60;net70</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<WarningsAsErrors>Nullable</WarningsAsErrors>
7+
</PropertyGroup>
8+
9+
<PropertyGroup>
10+
<PackageId>Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core</PackageId>
11+
<Title>Umbraco CMS Integrations: CRM - ActiveCampaign.Core</Title>
12+
<Description>Core package for Umbraco CMS integration with ActiveCampaign.</Description>
13+
<PackageIconUrl></PackageIconUrl>
14+
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main/src/Umbraco.Cms.Integrations.Crm.ActiveCampaign</PackageProjectUrl>
15+
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
16+
<Version>2.0.0</Version>
17+
<Authors>Umbraco HQ</Authors>
18+
<Company>Umbraco</Company>
19+
</PropertyGroup>
20+
21+
<ItemGroup Condition="'$(TargetFramework)' == 'net60'">
22+
<PackageReference Include="Umbraco.Cms.Web.Website" version="[10.0.0,11)" />
23+
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[10.0.0,11)" />
24+
<PackageReference Include="Umbraco.Cms.Web.Common" version="[10.0.0,11)" />
25+
</ItemGroup>
26+
27+
<ItemGroup Condition="'$(TargetFramework)' == 'net70'">
28+
<PackageReference Include="Umbraco.Cms.Web.Website" version="[11.0.0,12)" />
29+
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[11.0.0,12)" />
30+
<PackageReference Include="Umbraco.Cms.Web.Common" version="[11.0.0,12)" />
31+
</ItemGroup>
32+
33+
</Project>

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Umbraco.Cms.Integrations.Crm.ActiveCampaign.csproj

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net60;net70</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<WarningsAsErrors>Nullable</WarningsAsErrors>
77
</PropertyGroup>
@@ -13,19 +13,13 @@
1313
<PackageIconUrl></PackageIconUrl>
1414
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Cms.Integrations/tree/main/src/Umbraco.Cms.Integrations.Crm.ActiveCampaign</PackageProjectUrl>
1515
<RepositoryUrl>https://github.com/umbraco/Umbraco.Cms.Integrations</RepositoryUrl>
16-
<Version>1.0.2</Version>
16+
<Version>2.0.0</Version>
1717
<Authors>Umbraco HQ</Authors>
1818
<Company>Umbraco</Company>
1919
<PackageTags>Umbraco;Umbraco-Marketplace</PackageTags>
2020
<PackageIcon>activecampaign.png</PackageIcon>
2121
</PropertyGroup>
2222

23-
<ItemGroup>
24-
<PackageReference Include="Umbraco.Cms.Web.Website" version="10.1.0" />
25-
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="10.1.0" />
26-
<PackageReference Include="Umbraco.Cms.Web.Common" version="10.1.0" />
27-
</ItemGroup>
28-
2923
<ItemGroup>
3024
<Content Include="App_Plugins\UmbracoCms.Integrations\Crm\ActiveCampaign\**\*.*">
3125
<Pack>true</Pack>
@@ -58,4 +52,8 @@
5852
</Content>
5953
</ItemGroup>
6054

55+
<ItemGroup>
56+
<ProjectReference Include="..\Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core\Umbraco.Cms.Integrations.Crm.ActiveCampaign.Core.csproj" />
57+
</ItemGroup>
58+
6159
</Project>

src/Umbraco.Cms.Integrations.Crm.Dynamics/Controllers/FormsController.cs

+4-9
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public async Task<string> GetAccessToken([FromBody] OAuthRequestDto authRequestD
9393
{ "grant_type", "authorization_code" },
9494
{ "client_id", AuthorizationService.ClientId },
9595
{ "redirect_uri", AuthorizationService.RedirectUri },
96-
{ "code", authRequestDto.Code }
96+
{ "code", authRequestDto.Code }
9797
};
9898

9999
var requestMessage = new HttpRequestMessage
@@ -121,15 +121,10 @@ public async Task<string> GetAccessToken([FromBody] OAuthRequestDto authRequestD
121121
return result;
122122
}
123123

124-
if (response.StatusCode == HttpStatusCode.BadRequest)
125-
{
126-
var errorResult = await response.Content.ReadAsStringAsync();
127-
var errorDto = JsonConvert.DeserializeObject<ErrorDto>(errorResult);
128-
129-
return "Error: " + errorDto.ErrorDescription;
130-
}
124+
var errorResult = await response.Content.ReadAsStringAsync();
125+
var errorDto = JsonConvert.DeserializeObject<ErrorDto>(errorResult);
131126

132-
return "Error: An unexpected error occurred.";
127+
return "Error: " + errorDto.ErrorDescription;
133128
}
134129

135130
[HttpGet]

src/Umbraco.Cms.Integrations.Crm.Hubspot/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/js/formpicker.controller.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
if (response.isExpired === true || response.isValid === false) {
7171
vm.loading = false;
72-
notificationsService.warning("HubSpot API", "Unable to connect to HubSpot. Please review the settings of the form picker property's data type.");
72+
notificationsService.warning("HubSpot API", response.error);
7373
return;
7474
}
7575

@@ -78,7 +78,7 @@
7878
vm.hubspotFormsList = data.forms;
7979

8080
if (data.isValid === false || data.isExpired === true) {
81-
notificationsService.error("HubSpot API", "Unable to retrieve the list of forms from HubSpot. Please review the settings of the form picker property's data type.");
81+
notificationsService.error("HubSpot API", response.error);
8282
} else
8383
vm.isConnected = true;
8484
});
@@ -91,7 +91,7 @@
9191
vm.hubspotFormsList = data.forms;
9292

9393
if (data.isValid === false || data.isExpired === true) {
94-
notificationsService.error("HubSpot API", "Invalid API key");
94+
notificationsService.error("HubSpot API", data.error);
9595
} else
9696
vm.isConnected = true;
9797
});

src/Umbraco.Cms.Integrations.Crm.Hubspot/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/package.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Umbraco.Cms.Integrations.Crm.Hubspot",
3-
"version": "1.1.6",
3+
"version": "2.0.0",
44
"allowPackageTelemetry": true,
55
"javascript": [
66
"~/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/js/formpicker.controller.js",

src/Umbraco.Cms.Integrations.Crm.Hubspot/Constants.cs

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ public static class Configuration
1717
public const string Settings = "Umbraco:Cms:Integrations:Crm:Hubspot:Settings";
1818
}
1919

20+
public static class ErrorMessages
21+
{
22+
public const string TokenPermissions = "Token does not have the required permissions.";
23+
24+
public const string InvalidApiKey = "Invalid API key.";
25+
26+
public const string ApiKeyMissing = "Cannot access Hubspot - API key is missing";
27+
28+
public const string AccessTokenMissing = "Cannot access Hubspot - Access Token is missing.";
29+
30+
public const string OAuthInvalidToken = "Unable to connect to HubSpot. Please review the settings of the form picker property's data type.";
31+
32+
public const string OAuthFetchFormsConfigurationFailed = "Unable to retrieve the list of forms from HubSpot. Please review the settings of the form picker property's data type.";
33+
}
34+
2035
internal static readonly JsonSerializerSettings SerializationSettings = new JsonSerializerSettings
2136
{
2237
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,

0 commit comments

Comments
 (0)