Skip to content

Commit 9ec1b05

Browse files
Update to v15
1 parent 306ad3d commit 9ec1b05

30 files changed

+452
-3968
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<Company>Umbraco HQ</Company>
55
<Authors>Umbraco</Authors>
66
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
</PropertyGroup>
55
<ItemGroup>
66
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
7-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.5.119" />
7+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
88
<GlobalPackageReference Include="Umbraco.Code" Version="2.2.0" />
99
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
1010
<GlobalPackageReference Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" PrivateAssets="all" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<PackageVersion Include="Umbraco.Commerce.Cms.Startup" Version="[14.1.0, 15)" />
14-
<PackageVersion Include="Umbraco.Deploy.Infrastructure" Version="[14.1.0, 15)" />
13+
<PackageVersion Include="Umbraco.Commerce.Cms.Startup" Version="[15.0.0-rc1, 16)" />
14+
<PackageVersion Include="Umbraco.Deploy.Infrastructure" Version="[15.0.0-rc2, 16)" />
1515
</ItemGroup>
1616
</Project>

NuGet.config

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
56
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
67
<add key="Umbraco Nightly" value="https://www.myget.org/F/umbraconightly/api/v3/index.json" />
8+
<add key="Umbraco Cloud Bundle" value="https://www.myget.org/F/uc-bundle/api/v3/index.json" />
79
</packageSources>
810
<packageSourceMapping>
911
<packageSource key="nuget.org">
1012
<package pattern="*" />
13+
<package pattern="Umbraco.*" />
14+
</packageSource>
15+
<packageSource key="Umbraco Cloud Bundle">
16+
<package pattern="Umbraco.*" />
17+
</packageSource>
18+
<packageSource key="Umbraco Prereleases">
19+
<package pattern="Umbraco.Commerce" />
1120
<package pattern="Umbraco.Commerce.*" />
21+
<package pattern="Umbraco.Licenses" />
1222
</packageSource>
1323
<packageSource key="Umbraco Nightly">
24+
<package pattern="Umbraco.Commerce" />
1425
<package pattern="Umbraco.Commerce.*" />
26+
<package pattern="Umbraco.Licenses" />
1527
</packageSource>
1628
</packageSourceMapping>
17-
</configuration>
29+
</configuration>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100-rc.2.23502.2",
3+
"version": "9.0.100-rc.2.24474.11",
44
"rollForward": "latestFeature"
55
}
66
}

src/Umbraco.Commerce.Deploy/Composing/UmbracoCommerceDeployComponent.cs

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -77,66 +77,69 @@ private void InitializeIntegratedEntities()
7777
[
7878
Cms.Constants.Trees.Stores.NodeType.ProductAttributes,
7979
Cms.Constants.Trees.Stores.NodeType.ProductAttribute
80-
]),
81-
(string nodeId, HttpContext httpContext, out Guid entityId) =>
82-
{
83-
if (Guid.TryParse(nodeId, out entityId))
84-
{
85-
return true;
86-
}
87-
else if (int.TryParse(nodeId, out int id) && id == Cms.Constants.Trees.Stores.Ids[Cms.Constants.Trees.Stores.NodeType.ProductAttributes])
88-
{
89-
entityId = Guid.Empty;
90-
return true;
91-
}
92-
else
93-
{
94-
entityId = Guid.Empty;
95-
return false;
96-
}
97-
});
80+
])
81+
);
82+
// (string nodeId, HttpContext httpContext, out Guid entityId) =>
83+
// {
84+
// if (Guid.TryParse(nodeId, out entityId))
85+
// {
86+
// return true;
87+
// }
88+
// else if (int.TryParse(nodeId, out int id) && id == Cms.Constants.Trees.Stores.Ids[Cms.Constants.Trees.Stores.NodeType.ProductAttributes])
89+
// {
90+
// entityId = Guid.Empty;
91+
// return true;
92+
// }
93+
// else
94+
// {
95+
// entityId = Guid.Empty;
96+
// return false;
97+
// }
98+
// });
9899
// TODO: , new DeployTransferRegisteredEntityTypeDetail.RemoteTreeDetail(FormsTreeHelper.GetExampleTree, "example", "externalExampleTree"));
99100

100-
transferEntityService.RegisterTransferEntityType<ProductAttributePresetReadOnly>(
101-
"uc:product-attribute-presets",
102-
"Product Attribute Presets",
103-
new DeployRegisteredEntityTypeDetailOptions
104-
{
105-
SupportsQueueForTransfer = true,
106-
//SupportsQueueForTransferOfDescendents = true,
107-
SupportsRestore = true,
108-
PermittedToRestore = true,
109-
SupportsPartialRestore = true,
110-
SupportsImportExport = true,
111-
//SupportsExportOfDescendants = true
112-
},
113-
false,
114-
"commerce",
115-
(string routePath, HttpContext httpContext) => MatchesRoutePath(routePath, "productattributepreset"),
116-
(string nodeId, HttpContext httpContext) => MatchesNodeId(
117-
nodeId,
118-
httpContext,
119-
[
120-
Cms.Constants.Trees.Stores.NodeType.ProductAttributePresets,
121-
Cms.Constants.Trees.Stores.NodeType.ProductAttributePreset
122-
]),
123-
(string nodeId, HttpContext httpContext, out Guid entityId) =>
124-
{
125-
if (Guid.TryParse(nodeId, out entityId))
126-
{
127-
return true;
128-
}
129-
else if (int.TryParse(nodeId, out int id) && id == Cms.Constants.Trees.Stores.Ids[Cms.Constants.Trees.Stores.NodeType.ProductAttributePresets])
101+
transferEntityService.RegisterTransferEntityType<ProductAttributePresetReadOnly>(
102+
"uc:product-attribute-presets",
103+
"Product Attribute Presets",
104+
new DeployRegisteredEntityTypeDetailOptions
130105
{
131-
entityId = Guid.Empty;
132-
return true;
133-
}
134-
else
135-
{
136-
entityId = Guid.Empty;
137-
return false;
138-
}
139-
});
106+
SupportsQueueForTransfer = true,
107+
//SupportsQueueForTransferOfDescendents = true,
108+
SupportsRestore = true,
109+
PermittedToRestore = true,
110+
SupportsPartialRestore = true,
111+
SupportsImportExport = true,
112+
//SupportsExportOfDescendants = true
113+
},
114+
false,
115+
"commerce",
116+
(string routePath, HttpContext httpContext) =>
117+
MatchesRoutePath(routePath, "productattributepreset"),
118+
(string nodeId, HttpContext httpContext) => MatchesNodeId(
119+
nodeId,
120+
httpContext,
121+
[
122+
Cms.Constants.Trees.Stores.NodeType.ProductAttributePresets,
123+
Cms.Constants.Trees.Stores.NodeType.ProductAttributePreset
124+
])
125+
);
126+
// (string nodeId, HttpContext httpContext, out Guid entityId) =>
127+
// {
128+
// if (Guid.TryParse(nodeId, out entityId))
129+
// {
130+
// return true;
131+
// }
132+
// else if (int.TryParse(nodeId, out int id) && id == Cms.Constants.Trees.Stores.Ids[Cms.Constants.Trees.Stores.NodeType.ProductAttributePresets])
133+
// {
134+
// entityId = Guid.Empty;
135+
// return true;
136+
// }
137+
// else
138+
// {
139+
// entityId = Guid.Empty;
140+
// return false;
141+
// }
142+
// });
140143
// TODO: , new DeployTransferRegisteredEntityTypeDetail.RemoteTreeDetail(FormsTreeHelper.GetExampleTree, "example", "externalExampleTree"));
141144
}
142145

src/Umbraco.Commerce.Deploy/Connectors/ServiceConnectors/UmbracoCommerceCountryServiceConnector.cs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Umbraco.Commerce.Deploy.Configuration;
1010
using Umbraco.Cms.Core;
1111
using Umbraco.Cms.Core.Deploy;
12+
using Umbraco.Commerce.Extensions;
1213

1314
namespace Umbraco.Commerce.Deploy.Connectors.ServiceConnectors
1415
{
@@ -39,12 +40,12 @@ public override string GetEntityName(CountryReadOnly entity)
3940
=> entity.Name;
4041

4142
public override Task<CountryReadOnly?> GetEntityAsync(Guid id, CancellationToken cancellationToken = default)
42-
=> Task.FromResult((CountryReadOnly?)_umbracoCommerceApi.GetCountry(id));
43+
=> _umbracoCommerceApi.GetCountryAsync(id);
4344

4445
public override IAsyncEnumerable<CountryReadOnly> GetEntitiesAsync(
4546
Guid storeId,
4647
CancellationToken cancellationToken = default)
47-
=> _umbracoCommerceApi.GetCountries(storeId).ToAsyncEnumerable();
48+
=> _umbracoCommerceApi.GetCountriesAsync(storeId).AsAsyncEnumerable();
4849

4950
public override Task<CountryArtifact?> GetArtifactAsync(GuidUdi? udi, CountryReadOnly? entity, CancellationToken cancellationToken = default)
5051
{
@@ -135,84 +136,80 @@ public override async Task ProcessAsync(
135136
}
136137
}
137138

138-
private Task Pass2Async(ArtifactDeployState<CountryArtifact, CountryReadOnly> state, IDeployContext context, CancellationToken cancellationToken = default) =>
139-
_umbracoCommerceApi.Uow.ExecuteAsync(
140-
(uow, ct) =>
139+
private async Task Pass2Async(ArtifactDeployState<CountryArtifact, CountryReadOnly> state, IDeployContext context, CancellationToken cancellationToken = default) =>
140+
await _umbracoCommerceApi.Uow.ExecuteAsync(
141+
async (uow, ct) =>
141142
{
142143
CountryArtifact artifact = state.Artifact;
143144

144145
artifact.Udi.EnsureType(UmbracoCommerceConstants.UdiEntityType.Country);
145146
artifact.StoreUdi.EnsureType(UmbracoCommerceConstants.UdiEntityType.Store);
146147

147-
Country? entity = state.Entity?.AsWritable(uow) ?? Country.Create(
148+
Country? entity = await state.Entity?.AsWritableAsync(uow)! ?? await Country.CreateAsync(
148149
uow,
149150
artifact.Udi.Guid,
150151
artifact.StoreUdi.Guid,
151152
artifact.Code,
152153
artifact.Name);
153154

154-
entity.SetName(artifact.Name)
155-
.SetCode(artifact.Code)
156-
.SetSortOrder(artifact.SortOrder);
155+
await entity.SetNameAsync(artifact.Name)
156+
.SetCodeAsync(artifact.Code)
157+
.SetSortOrderAsync(artifact.SortOrder);
157158

158-
_umbracoCommerceApi.SaveCountry(entity);
159+
await _umbracoCommerceApi.SaveCountryAsync(entity, ct);
159160

160161
state.Entity = entity;
161162

162-
uow.Complete();
163-
164-
return Task.CompletedTask;
163+
await uow.CompleteAsync();
165164
},
166165
cancellationToken);
167166

168-
private Task Pass4Async(ArtifactDeployState<CountryArtifact, CountryReadOnly> state, IDeployContext context, CancellationToken cancellationToken = default) =>
169-
_umbracoCommerceApi.Uow.ExecuteAsync(
170-
(uow, ct) =>
167+
private async Task Pass4Async(ArtifactDeployState<CountryArtifact, CountryReadOnly> state, IDeployContext context, CancellationToken cancellationToken = default) =>
168+
await _umbracoCommerceApi.Uow.ExecuteAsync(
169+
async (uow, ct) =>
171170
{
172171
CountryArtifact artifact = state.Artifact;
173172

174173
if (state.Entity != null)
175174
{
176-
Country? entity = _umbracoCommerceApi.GetCountry(state.Entity.Id).AsWritable(uow);
175+
Country? entity = await _umbracoCommerceApi.GetCountryAsync(state.Entity.Id).AsWritableAsync(uow);
177176

178177
if (artifact.TaxCalculationMethodUdi != null)
179178
{
180179
artifact.TaxCalculationMethodUdi.EnsureType(UmbracoCommerceConstants.UdiEntityType.TaxCalculationMethod);
181180
// TODO: Check the tax calculation method exists?
182181
}
183182

184-
entity.SetTaxCalculationMethod(artifact.TaxCalculationMethodUdi?.Guid);
183+
await entity.SetTaxCalculationMethodAsync(artifact.TaxCalculationMethodUdi?.Guid);
185184

186185
if (artifact.DefaultCurrencyUdi != null)
187186
{
188187
artifact.DefaultCurrencyUdi.EnsureType(UmbracoCommerceConstants.UdiEntityType.Currency);
189188
// TODO: Check the currency exists?
190189
}
191190

192-
entity.SetDefaultCurrency(artifact.DefaultCurrencyUdi?.Guid);
191+
await entity.SetDefaultCurrencyAsync(artifact.DefaultCurrencyUdi?.Guid);
193192

194193
if (artifact.DefaultPaymentMethodUdi != null)
195194
{
196195
artifact.DefaultPaymentMethodUdi.EnsureType(UmbracoCommerceConstants.UdiEntityType.PaymentMethod);
197196
// TODO: Check the payment method exists?
198197
}
199198

200-
entity.SetDefaultPaymentMethod(artifact.DefaultPaymentMethodUdi?.Guid);
199+
await entity.SetDefaultPaymentMethodAsync(artifact.DefaultPaymentMethodUdi?.Guid);
201200

202201
if (artifact.DefaultShippingMethodUdi != null)
203202
{
204203
artifact.DefaultShippingMethodUdi.EnsureType(UmbracoCommerceConstants.UdiEntityType.ShippingMethod);
205204
// TODO: Check the payment method exists?
206205
}
207206

208-
entity.SetDefaultShippingMethod(artifact.DefaultShippingMethodUdi?.Guid);
207+
await entity.SetDefaultShippingMethodAsync(artifact.DefaultShippingMethodUdi?.Guid);
209208

210-
_umbracoCommerceApi.SaveCountry(entity);
209+
await _umbracoCommerceApi.SaveCountryAsync(entity, ct);
211210
}
212211

213-
uow.Complete();
214-
215-
return Task.CompletedTask;
212+
await uow.CompleteAsync();
216213
},
217214
cancellationToken);
218215
}

0 commit comments

Comments
 (0)