Skip to content

Commit 3d98fa8

Browse files
authored
Merge pull request #118 from umbraco/v16/hubspot
Hubspot CRM upgraded to V16
2 parents 501fcb7 + c1431ed commit 3d98fa8

35 files changed

+2047
-2186
lines changed

azure-pipeline - Crm.Hubspot.yml

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
trigger:
2-
- main
3-
- main-v10
2+
branches:
3+
include:
4+
- main-v16
5+
- v16/dev
6+
paths:
7+
include:
8+
- src/Umbraco.Forms.Integrations.Crm.Hubspot/**
9+
- azure-pipeline - Crm.Hubspot.yml
410

511
pool:
612
vmImage: 'windows-latest'
713

814
variables:
915
projectName: 'Umbraco.Forms.Integrations.Crm.Hubspot'
10-
solution: '**/*.sln'
1116
project: 'src/$(projectName)/$(projectName).csproj'
12-
testProject: 'src/$(projectName).Tests/$(projectName).Tests.csproj'
1317
buildPlatform: 'Any CPU'
1418
buildConfiguration: 'Release'
1519

1620
steps:
1721
- task: NuGetToolInstaller@1
1822
displayName: 'Install NuGet'
1923

20-
- task: NuGetCommand@2
24+
- task: DotNetCoreCLI@2
2125
displayName: 'NuGet Restore'
2226
inputs:
23-
restoreSolution: '$(solution)'
27+
command: 'restore'
28+
feedsToUse: 'select'
29+
projects: '$(project)'
30+
includeNuGetOrg: true
2431

25-
- task: VSBuild@1
26-
displayName: 'Build Project'
32+
- task: UseDotNet@2
33+
displayName: 'Use SDK version 9.0.203'
2734
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)'
35+
packageType: 'sdk'
36+
version: '9.0.203'
3237

3338
- task: VSBuild@1
34-
displayName: 'Build Tests'
39+
displayName: 'Build Project'
3540
inputs:
36-
solution: '$(testProject)'
41+
solution: '$(project)'
3742
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
3843
platform: '$(buildPlatform)'
3944
configuration: '$(buildConfiguration)'
4045

41-
- task: DotNetCoreCLI@2
42-
displayName: dotnet test
43-
inputs:
44-
command: test
45-
projects: '**/*.Tests.csproj'
46-
4746
- task: DotNetCoreCLI@2
4847
displayName: 'Create NuGet Package'
4948
inputs:
@@ -52,19 +51,9 @@ steps:
5251
packagesToPack: '$(project)'
5352
versioningScheme: 'off'
5453

55-
- task: CmdLine@2
56-
displayName: 'Create Umbraco Package'
57-
inputs:
58-
script: |
59-
dotnet tool install --global Umbraco.Tools.Packages
60-
cd src/$(projectName)/
61-
umbpack pack .\package.xml -o $(Build.ArtifactStagingDirectory)
62-
cd ../../
63-
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
64-
6554
- task: PublishBuildArtifacts@1
6655
displayName: 'Publish Build Artifacts'
6756
inputs:
6857
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
6958
ArtifactName: 'drop'
70-
publishLocation: 'Container'
59+
publishLocation: 'Container'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Umbraco.Cms.Api.Management.OpenApi;
2+
3+
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Configuration;
4+
5+
public class BackOfficeSecurityRequirementsOperationFilter : BackOfficeSecurityRequirementsOperationFilterBase
6+
{
7+
protected override string ApiName => Constants.ManagementApi.ApiName;
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Mvc.ApiExplorer;
3+
using Microsoft.AspNetCore.Mvc.Controllers;
4+
using Microsoft.Extensions.Options;
5+
using Umbraco.Cms.Api.Common.OpenApi;
6+
7+
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Configuration;
8+
9+
internal class HubspotFormsOperationIdHandler : OperationIdHandler
10+
{
11+
public HubspotFormsOperationIdHandler(IOptions<ApiVersioningOptions> apiVersioningOptions) : base(apiVersioningOptions)
12+
{
13+
}
14+
15+
protected override bool CanHandle(ApiDescription apiDescription, ControllerActionDescriptor controllerActionDescriptor)
16+
=> controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Forms.Integrations.Crm.Hubspot") is true;
17+
}

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/AuthorizeController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Dtos;
45
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
56

67
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
78
{
9+
[ApiVersion("1.0")]
810
public class AuthorizeController : ContactControllerBase
911
{
1012
public AuthorizeController(IContactService contactService) : base(contactService)

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/ContactControllerBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
77
{
8-
[ApiVersion("1.0")]
98
[BackOfficeRoute($"{Constants.ManagementApi.RootPath}/v{{version:apiVersion}}/contacts")]
109
[ApiExplorerSettings(GroupName = Constants.ManagementApi.ContactGroupName)]
1110
public class ContactControllerBase : HubspotControllerBase

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/DeauthorizeController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Dtos;
45
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
56

67
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
78
{
9+
[ApiVersion("1.0")]
810
public class DeauthorizeController : ContactControllerBase
911
{
1012
public DeauthorizeController(IContactService contactService) : base(contactService)

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/GetAllPropertiesController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Responses;
45
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
56

67
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
78
{
9+
[ApiVersion("1.0")]
810
public class GetAllPropertiesController : ContactControllerBase
911
{
1012
public GetAllPropertiesController(IContactService contactService) : base(contactService)

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/GetAuthenticationUrlController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
45

56
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
67
{
8+
[ApiVersion("1.0")]
79
public class GetAuthenticationUrlController : ContactControllerBase
810
{
911
public GetAuthenticationUrlController(IContactService contactService) : base(contactService)

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Contacts/IsAuthorizationConfiguredController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
using Microsoft.AspNetCore.Http;
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
45

56
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
67
{
8+
[ApiVersion("1.0")]
79
public class IsAuthorizationConfiguredController : ContactControllerBase
810
{
911
public IsAuthorizationConfiguredController(IContactService contactService) : base(contactService)

src/Umbraco.Forms.Integrations.Crm.Hubspot/Api/Management/Controllers/Forms/FormControllerBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Forms
77
{
8-
[ApiVersion("1.0")]
98
[BackOfficeRoute($"{Constants.ManagementApi.RootPath}/v{{version:apiVersion}}/forms")]
109
[ApiExplorerSettings(GroupName = Constants.ManagementApi.FormGroupName)]
1110
public class FormControllerBase : HubspotControllerBase

0 commit comments

Comments
 (0)