Skip to content

Commit 2000e76

Browse files
authored
Merge pull request #103 from umbraco/v14/feature/42961-V14-Integrations-(HubSpot/Forms)
V14: Integrations (HubSpot/Forms)
2 parents 08b6bd3 + 7c5c5a9 commit 2000e76

File tree

53 files changed

+610
-1243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+610
-1243
lines changed
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Dtos;
94
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
105

@@ -17,7 +12,7 @@ public AuthorizeController(IContactService contactService) : base(contactService
1712
}
1813

1914
[HttpPost("authorize")]
20-
[ProducesResponseType(typeof(Task<AuthorizationResult>), StatusCodes.Status200OK)]
21-
public async Task<IActionResult> Authorize([FromBody] AuthorizationRequest request) => Ok(await ContactService.AuthorizeAsync(request.Code));
15+
[ProducesResponseType(typeof(AuthorizationResult), StatusCodes.Status200OK)]
16+
public async Task<IActionResult> Authorize([FromBody]AuthorizationRequest request) => Ok(await ContactService.AuthorizeAsync(request.Code));
2217
}
2318
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Asp.Versioning;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83
using Umbraco.Cms.Web.Common.Routing;
94
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
105

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Dtos;
94
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
105

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
8-
using Umbraco.Cms.Web.Common.Attributes;
93
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Responses;
104
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
115

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
94

105
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using Microsoft.AspNetCore.Http;
22
using Microsoft.AspNetCore.Mvc;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83
using Umbraco.Forms.Integrations.Crm.Hubspot.Services;
94

105
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Contacts
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Mvc;
3+
using Umbraco.Cms.Web.Common.Routing;
4+
using Umbraco.Forms.Core.Services;
5+
6+
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Forms
7+
{
8+
[ApiVersion("1.0")]
9+
[BackOfficeRoute($"{Constants.ManagementApi.RootPath}/v{{version:apiVersion}}/forms")]
10+
[ApiExplorerSettings(GroupName = Constants.ManagementApi.FormGroupName)]
11+
public class FormControllerBase : HubspotControllerBase
12+
{
13+
protected readonly IFormService FormService;
14+
15+
public FormControllerBase(IFormService formService)
16+
{
17+
FormService = formService;
18+
}
19+
}
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.AspNetCore.Http;
2+
using Microsoft.AspNetCore.Mvc;
3+
using Umbraco.Forms.Core.Services;
4+
using Umbraco.Forms.Integrations.Crm.Hubspot.Models.Dtos;
5+
6+
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers.Forms
7+
{
8+
public class GetFormFieldsController : FormControllerBase
9+
{
10+
public GetFormFieldsController(IFormService formService) : base(formService)
11+
{
12+
}
13+
14+
[HttpGet("fields")]
15+
[ProducesResponseType(typeof(List<HubspotWorkflowFormFieldDto>), StatusCodes.Status200OK)]
16+
public IActionResult GetFormFields(string formId)
17+
{
18+
List<HubspotWorkflowFormFieldDto> formFields = new List<HubspotWorkflowFormFieldDto>();
19+
var result = FormService.Get(new Guid(formId));
20+
if (result != null)
21+
{
22+
formFields = result.AllFields.Select(s => new HubspotWorkflowFormFieldDto{ Caption = s.Caption, Id = s.Id }).ToList();
23+
}
24+
return Ok(formFields);
25+
}
26+
}
27+
}

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
using Asp.Versioning;
2-
using Microsoft.AspNetCore.Authorization;
1+
using Microsoft.AspNetCore.Authorization;
32
using Microsoft.AspNetCore.Mvc;
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
93
using Umbraco.Cms.Api.Common.Attributes;
104
using Umbraco.Cms.Web.Common.Authorization;
11-
using Umbraco.Cms.Web.Common.Routing;
125

136
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Api.Management.Controllers
147
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const outputPath = 'Debug' !== 'Release' ? '../wwwroot' : '../obj/Debug/net8.0/clientassets'
1+
export const outputPath = 'Debug' !== 'Release' ? '../wwwroot' : '../obj/Debug/net8.0/clientassets'

0 commit comments

Comments
 (0)