Skip to content

Commit b993cdf

Browse files
committed
Hubspot authentication directive updates.
1 parent f209b10 commit b993cdf

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
}
3030

3131
if (response.isValid !== true) {
32-
notificationsService.warning("HubSpot Configuration",
33-
"Invalid setup. Please review the API/OAuth settings.");
32+
// if directive runs from property editor, the notifications should be hidden, because they will not be displayed properly behind the overlay window.
33+
// if directive runs from data type, the notifications are displayed
34+
if (typeof $scope.connected === "undefined")
35+
notificationsService.warning("HubSpot Configuration",
36+
"Invalid setup. Please review the API/OAuth settings.");
3437
}
3538
});
3639

@@ -46,7 +49,12 @@
4649
vm.onRevokeToken = function() {
4750
umbracoCmsIntegrationsCrmHubspotResource.revokeAccessToken().then(function (response) {
4851
vm.oauthSetup.isConnected = false;
49-
notificationsService.success("HubSpot Configuration", "OAuth connection revoked.");
52+
53+
if(typeof $scope.connected === "undefined")
54+
notificationsService.success("HubSpot Configuration", "OAuth connection revoked.");
55+
56+
if (typeof $scope.revoked === "function")
57+
$scope.revoked();
5058
});
5159
}
5260

@@ -56,11 +64,17 @@
5664

5765
umbracoCmsIntegrationsCrmHubspotResource.getAccessToken(event.data.code).then(function (response) {
5866
if (response.startsWith("Error:")) {
59-
notificationsService.error("HubSpot Configuration", response);
67+
if (typeof $scope.connected === "undefined")
68+
notificationsService.error("HubSpot Configuration", response);
6069
} else {
6170
vm.oauthSetup.isConnected = true;
6271
vm.status.description = umbracoCmsIntegrationsCrmHubspotService.configDescription.OAuthConnected;
63-
notificationsService.success("HubSpot Configuration", "OAuth connected.");
72+
73+
if (typeof $scope.connected === "undefined")
74+
notificationsService.success("HubSpot Configuration", "OAuth connected.");
75+
76+
if (typeof $scope.connected === "function")
77+
$scope.connected();
6478
}
6579
});
6680

src/Umbraco.Cms.Integrations.Crm.Hubspot/App_Plugins/UmbracoCms.Integrations/Crm/Hubspot/views/formpickereditor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</umb-box-content>
2525
</umb-box>
2626
<umb-box>
27-
<umb-box-header title="HubSpot - Authorization Status" description="Please connect to HubSpot."></umb-box-header>
27+
<umb-box-header title="HubSpot API" description="Please connect to HubSpot."></umb-box-header>
2828
<umb-box-content>
2929
<div class="hsOverlayGroup">
3030
<hubspot-authorization on-connected="connected()" on-revoked="revoked()"></hubspot-authorization>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net50;net60</TargetFrameworks>
3+
<TargetFrameworks>net472;net50</TargetFrameworks>
44
</PropertyGroup>
55

66
<PropertyGroup>

0 commit comments

Comments
 (0)