Skip to content

Commit

Permalink
feat: add support for umbraco v12 (#26)
Browse files Browse the repository at this point in the history
* feat: add support for umbraco v12

* add missing file

* add missing file

* self review

* bump version number
  • Loading branch information
brianhdk committed Sep 23, 2023
1 parent b80bd43 commit 55432ae
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 24 deletions.
18 changes: 13 additions & 5 deletions samples/UmbracoV10/App_Plugins/Relewise.Dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ <h3>Settings</h3>
<span>Which then reads from the following configuration in appsettings.json:</span>
<pre>
"Relewise": {
"DatasetId": "00000000-0000-0000-0000-000000000000",
"ApiKey": "ApiKey",
"Timeout": "00:00:03"
"DatasetId": "&lt;your dataset id here&gt;",
"ApiKey": "&lt;your master api key here&gt;",
"ServerUrl": "&lt;your server url here&gt;",
"Timeout": "00:00:05"
}
</pre>
<span>Error message from server:</span>
Expand Down Expand Up @@ -108,8 +109,9 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">Name</div>
<div class="umb-table-cell not-fixed">DatasetId</div>
<div class="umb-table-cell not-fixed">Timeout</div>
<div class="umb-table-cell not-fixed">Dataset Id</div>
<div class="umb-table-cell not-fixed">Server Url</div>
<div class="umb-table-cell not-fixed">Timeout (seconds)</div>

</div>
</div>
Expand All @@ -127,41 +129,47 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<span class="pl-20">Tracker</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.serverUrl ? named.tracker.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Recommender</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.serverUrl ? named.recommender.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Searcher</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.serverUrl ? named.searcher.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Search Administrator</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.serverUrl ? named.searchAdministrator.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Analyzer</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.serverUrl ? named.analyzer.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Data Accessor</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.serverUrl ? named.dataAccessor.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.timeout }}</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions samples/UmbracoV10/Relewise.UmbracoV10.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Relewise.Client" Version="1.39.0" />
<PackageReference Include="Relewise.Client.Extensions" Version="1.3.1" />
<PackageReference Include="Relewise.Client" Version="1.96.0" />
<PackageReference Include="Relewise.Client.Extensions" Version="1.4.1" />
<PackageReference Include="Umbraco.Cms" Version="10.3.2" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.3.2" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions samples/UmbracoV10/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"Relewise": {
"DatasetId": "<your dataset id here>",
"ApiKey": "<your master api key here>",
"ServerUrl": "<your server url here>",
"Timeout": "00:00:05",
"Named": {
"Browser": {
Expand Down
18 changes: 13 additions & 5 deletions samples/UmbracoV9/App_Plugins/Relewise.Dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ <h3>Settings</h3>
<span>Which then reads from the following configuration in appsettings.json:</span>
<pre>
"Relewise": {
"DatasetId": "00000000-0000-0000-0000-000000000000",
"ApiKey": "ApiKey",
"Timeout": "00:00:03"
"DatasetId": "&lt;your dataset id here&gt;",
"ApiKey": "&lt;your master api key here&gt;",
"ServerUrl": "&lt;your server url here&gt;",
"Timeout": "00:00:05"
}
</pre>
<span>Error message from server:</span>
Expand Down Expand Up @@ -108,8 +109,9 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">Name</div>
<div class="umb-table-cell not-fixed">DatasetId</div>
<div class="umb-table-cell not-fixed">Timeout</div>
<div class="umb-table-cell not-fixed">Dataset Id</div>
<div class="umb-table-cell not-fixed">Server Url</div>
<div class="umb-table-cell not-fixed">Timeout (seconds)</div>

</div>
</div>
Expand All @@ -127,41 +129,47 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<span class="pl-20">Tracker</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.serverUrl ? named.tracker.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Recommender</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.serverUrl ? named.recommender.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Searcher</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.serverUrl ? named.searcher.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Search Administrator</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.serverUrl ? named.searchAdministrator.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Analyzer</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.serverUrl ? named.analyzer.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Data Accessor</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.serverUrl ? named.dataAccessor.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.timeout }}</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions samples/UmbracoV9/Relewise.UmbracoV9.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Relewise.Client" Version="1.39.0" />
<PackageReference Include="Relewise.Client.Extensions" Version="1.3.1" />
<PackageReference Include="Relewise.Client" Version="1.96.0" />
<PackageReference Include="Relewise.Client.Extensions" Version="1.4.1" />
<PackageReference Include="Umbraco.Cms" Version="9.5.4" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ <h3>Settings</h3>
<span>Which then reads from the following configuration in appsettings.json:</span>
<pre>
"Relewise": {
"DatasetId": "00000000-0000-0000-0000-000000000000",
"ApiKey": "ApiKey",
"Timeout": "00:00:03"
"DatasetId": "&lt;your dataset id here&gt;",
"ApiKey": "&lt;your master api key here&gt;",
"ServerUrl": "&lt;your server url here&gt;",
"Timeout": "00:00:05"
}
</pre>
<span>Error message from server:</span>
Expand Down Expand Up @@ -108,8 +109,9 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">Name</div>
<div class="umb-table-cell not-fixed">DatasetId</div>
<div class="umb-table-cell not-fixed">Timeout</div>
<div class="umb-table-cell not-fixed">Dataset Id</div>
<div class="umb-table-cell not-fixed">Server Url</div>
<div class="umb-table-cell not-fixed">Timeout (seconds)</div>

</div>
</div>
Expand All @@ -127,41 +129,47 @@ <h3 ng-if="vm.configuration !== null && vm.configuration.named">Clients</h3>
<span class="pl-20">Tracker</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.serverUrl ? named.tracker.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.tracker.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Recommender</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.serverUrl ? named.recommender.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.recommender.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Searcher</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.serverUrl ? named.searcher.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searcher.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Search Administrator</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.serverUrl ? named.searchAdministrator.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.searchAdministrator.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Analyzer</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.serverUrl ? named.analyzer.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.analyzer.timeout }}</div>
</div>
<div class="umb-table-row">
<div class="umb-table-cell not-fixed umb-table__name">
<span class="pl-20">Data Accessor</span>
</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.datasetId }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.serverUrl ? named.dataAccessor.serverUrl : "(default)" }}</div>
<div class="umb-table-cell not-fixed">{{ named.dataAccessor.timeout }}</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,12 @@ private class ClientOptionsViewObject
public ClientOptionsViewObject(RelewiseClientOptions options)
{
DatasetId = options.DatasetId;
ServerUrl = options.ServerUrl?.ToString();
Timeout = options.Timeout.TotalSeconds;
}

public Guid DatasetId { get; }
public string? ServerUrl { get; }
public double Timeout { get; }
}
}
2 changes: 1 addition & 1 deletion src/Integrations.Umbraco/Dashboards/RelewiseDashboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Relewise.Integrations.Umbraco.Dashboards;
internal class RelewiseDashboard : IDashboard
{
public string Alias => "relewiseDashboard";
public string View => "/App_Plugins/Relewise.Dashboard/dashboard.html?v=3";
public string View => "/App_Plugins/Relewise.Dashboard/dashboard.html?v=4";
public string[] Sections => new[] { "Settings" };
public IAccessRule[] AccessRules => Array.Empty<IAccessRule>();
}
8 changes: 4 additions & 4 deletions src/Integrations.Umbraco/Integrations.Umbraco.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Relewise.Client" Version="[1.35.0, 2)" />
<PackageReference Include="Relewise.Client.Extensions" Version="[1.3.1, 2)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[9.0.0,12)" />
<PackageReference Include="Umbraco.Cms.Web.Common" version="[9.0.0,12)" />
<PackageReference Include="Relewise.Client" Version="[1.96.0, 2)" />
<PackageReference Include="Relewise.Client.Extensions" Version="[1.4.1, 2)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" version="[9.0.0,13)" />
<PackageReference Include="Umbraco.Cms.Web.Common" version="[9.0.0,13)" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 55432ae

Please sign in to comment.