Skip to content

Commit ba5d3aa

Browse files
committed
Aligned namespaces, updated readmes
1 parent ea8c800 commit ba5d3aa

File tree

14 files changed

+62
-45
lines changed

14 files changed

+62
-45
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# Umbraco.Forms.Extensions
2-
This is a repository to include extensions for Forms for the DXP program at Umbraco HQ
1+
# Umbraco.Forms.Integrations
2+
3+
This repository houses open-source extensions, created for Umbraco Forms, that integrate with third-party plaforms.
4+
5+
## Available Integrations
6+
7+
### CRM
8+
9+
[Hubspot](./src/Umbraco.Forms.Integrations.Crm.Hubspot/) - a custom workflow allowing form form entries to be mapped to a HubSpot contact record, and stored within the CRM platform.

src/Umbraco.Forms.Integrations.Crm.Hubspot/App_Plugins/UmbracoFormsExtensions/Hubspot/hubspot.resource.js renamed to src/Umbraco.Forms.Integrations.Crm.Hubspot/App_Plugins/UmbracoForms.Integrations/Crm/Hubspot/hubspot.resource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
return umbRequestHelper.resourcePromise(
66
$http.get(
77
umbRequestHelper.getApiUrl(
8-
"umbracoFormsExtensionsHubspotBaseUrl",
8+
"umbracoFormsIntegrationsCrmHubspotBaseUrl",
99
"GetAllProperties")),
1010
'Failed to get Hubspot Properties');
1111
},
1212
};
1313
}
1414

15-
angular.module('umbraco.resources').factory('hubspotResource', hubspotResource);
15+
angular.module('umbraco.resources').factory('umbracoFormsIntegrationsCrmHubspotResource', hubspotResource);
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
angular
22
.module("umbraco")
3-
.component("umbFormsHubspotFields", {
3+
.component("umbFormsIntegrationsCrmHubspotFields", {
44
controller: HubSpotFieldsController,
55
controllerAs: "vm",
6-
templateUrl: "/App_Plugins/UmbracoFormsExtensions/hubspot/hubspot-field-mapper-template.html",
6+
templateUrl: "/App_Plugins/UmbracoForms.Integrations/Crm/Hubspot/hubspot-field-mapper-template.html",
77
bindings: {
88
setting: "<"
9-
},
10-
9+
},
1110
}
1211
);
1312

14-
function HubSpotFieldsController($scope, $compile, $element, $routeParams, hubspotResource, pickerResource) {
13+
function HubSpotFieldsController($routeParams, umbracoFormsIntegrationsCrmHubspotResource, pickerResource) {
1514
var vm = this;
1615

17-
// its repating with umb-control-group for each workflow setting
18-
// parent view/controller that has the model.workflow.settings...
19-
// umbracoForms.Overlays.WorkflowSettingsOverlayController as vm
20-
2116
vm.$onInit = function() {
22-
console.log('$scope', $scope);
23-
console.log('vm', vm);
24-
25-
//console.log('vm.parentDirective', vm.parentDirective);
2617

2718
if (!vm.setting.value) {
2819
vm.mappings = [];
@@ -33,12 +24,13 @@ function HubSpotFieldsController($scope, $compile, $element, $routeParams, hubsp
3324
var formId = $routeParams.id;
3425
if (formId !== -1){
3526

36-
// Available Form Fields
27+
// Get the fields for the form.
3728
pickerResource.getAllFields(formId).then(function (response) {
3829
vm.fields = response.data;
3930
});
4031

41-
hubspotResource.getAllProperties().then(function (response) {
32+
// Get the HubSpot contact fields.
33+
umbracoFormsIntegrationsCrmHubspotResource.getAllProperties().then(function (response) {
4234
vm.hubspotFields = response.map(x => {
4335
return {
4436
value: x.name,
@@ -63,7 +55,8 @@ function HubSpotFieldsController($scope, $compile, $element, $routeParams, hubsp
6355
}
6456

6557
vm.addMapping = function () {
66-
// Add new empty object into array
58+
59+
// Add new empty object into the mappings array.
6760
vm.mappings.push({
6861
formField: "",
6962
hubspotField: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<umb-forms-integrations-crm-hubspot-fields setting="setting"></umb-forms-integrations-crm-hubspot-fields>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"css": [ "" ],
3+
"javascript": [
4+
"~/App_Plugins/UmbracoForms.Integrations/Crm/Hubspot/hubspotfields.component.js",
5+
"~/App_Plugins/UmbracoForms.Integrations/Crm/Hubspot/hubspot.resource.js"
6+
]
7+
}

src/Umbraco.Forms.Integrations.Crm.Hubspot/App_Plugins/UmbracoFormsExtensions/Hubspot/hubspotfields.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Umbraco.Forms.Integrations.Crm.Hubspot/App_Plugins/UmbracoFormsExtensions/Hubspot/package.manifest

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/Umbraco.Forms.Integrations.Crm.Hubspot/Controllers/HubspotController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Umbraco.Forms.Integrations.Crm.Hubspot.Controllers
99
{
10-
[PluginController("FormsExtensions")]
10+
[PluginController("UmbracoFormsIntegrationsCrmHubspot")]
1111
public class HubspotController : UmbracoAuthorizedJsonController
1212
{
1313
private readonly IContactService _contactService;

src/Umbraco.Forms.Integrations.Crm.Hubspot/HubspotComponent.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,29 @@ public void Initialize()
2020
private void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> e)
2121
{
2222
if (!e.ContainsKey("umbracoUrls"))
23+
{
2324
throw new ArgumentException("Missing umbracoUrls.");
25+
}
2426

2527
var umbracoUrlsObject = e["umbracoUrls"];
2628
if (umbracoUrlsObject == null)
29+
{
2730
throw new ArgumentException("Null umbracoUrls");
31+
}
2832

2933
if (!(umbracoUrlsObject is Dictionary<string, object> umbracoUrls))
34+
{
3035
throw new ArgumentException("Invalid umbracoUrls");
36+
}
37+
38+
if (HttpContext.Current == null)
39+
{
40+
throw new InvalidOperationException("HttpContext is null");
41+
}
3142

32-
if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
3343
var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
3444

35-
umbracoUrls["umbracoFormsExtensionsHubspotBaseUrl"] = urlHelper.GetUmbracoApiServiceBaseUrl<HubspotController>(controller => controller.GetAllProperties());
45+
umbracoUrls["umbracoFormsIntegrationsCrmHubspotBaseUrl"] = urlHelper.GetUmbracoApiServiceBaseUrl<HubspotController>(controller => controller.GetAllProperties());
3646
}
3747

3848
public void Terminate()

0 commit comments

Comments
 (0)