Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageVersion Include="Umbraco.Cms.DevelopmentMode.Backoffice" Version="17.4.2" />
<PackageVersion Include="Our.Umbraco.ConditionalDisplayers" Version="16.6.0" />
<PackageVersion Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<PackageVersion Include="Clean" Version="7.0.5" />
<PackageVersion Include="Clean.Core" Version="7.0.5" />
</ItemGroup>
<!-- umbraco libraries for packages -->
Expand Down
23 changes: 11 additions & 12 deletions uSync.BackOffice/HealthChecks/SyncFolderIntegrityChecks.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;

Expand All @@ -23,7 +24,6 @@ public class SyncFolderIntegrityChecks : HealthCheck
private readonly ISyncConfigService? _configService;
private readonly ISyncFileService? _fileService;


public SyncFolderIntegrityChecks() { }

/// <summary>
Expand All @@ -44,17 +44,8 @@ public override HealthCheckStatus ExecuteAction(HealthCheckAction action)
/// <inheritdoc/>
public override Task<IEnumerable<HealthCheckStatus>> GetStatusAsync()
{
if (_configService is null || _fileService is null)
{
return Task.FromResult((IEnumerable<HealthCheckStatus>)new List<HealthCheckStatus>
{
new HealthCheckStatus("uSync services not available")
{
Description = "The uSync services are not available, this likely means the site has no backoffice loaded.",
ResultType = StatusResultType.Info
}
});
}
if (_configService is null || _fileService is null)
return Task.FromResult(Enumerable.Empty<HealthCheckStatus>());

var items = new List<HealthCheckStatus>
{
Expand All @@ -67,6 +58,9 @@ public override Task<IEnumerable<HealthCheckStatus>> GetStatusAsync()

private HealthCheckStatus CheckuSyncFolder()
{
if (_configService is null || _fileService is null)
return new HealthCheckStatus("Unable to check uSync folder integrity");

var root = _fileService.GetAbsPath(_configService.GetWorkingFolder());

if (_fileService.DirectoryExists(root) is false)
Expand Down Expand Up @@ -100,6 +94,8 @@ private HealthCheckStatus CheckuSyncFolder()

private List<string> CheckFolder(string folder)
{
if (_fileService is null) return [];

var _keys = new Dictionary<Guid, string>();

var clashes = new List<string>();
Expand Down Expand Up @@ -143,6 +139,9 @@ private List<string> CheckFolder(string folder)

private HealthCheckStatus CheckConfigFolderValidity()
{
if (_configService is null || _fileService is null)
return new HealthCheckStatus("Unable to check uSync folder integrity");

var root = _fileService.GetAbsPath(_configService.GetWorkingFolder());

if (_fileService.DirectoryExists(root) is false)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"homepage": "https://jumoo.co.uk/uSync",
"license": "MPL-2.0",
"type": "module",
"version": "17.3.3",
"version": "17.3.4",
"main": "./dist/usync.js",
"types": "./dist/index.d.ts",
"module": "./dist/usync.js",
Expand Down
15 changes: 4 additions & 11 deletions uSync.Core/Mapping/SyncBlockMapperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,11 @@ public SyncBlockMapperBase(
_logger.LogDebug("Importing block value for {PropertyEditorAlias} {valueType}", propertyType.PropertyEditorAlias, value?.GetType().Name ?? "blank");

var importString = SyncBlockMapperBase<TBlockValue>.GetStringValue(value) ?? string.Empty;
var result = await _mapperCollection.Value.GetImportValueAsync(importString, propertyType, options);

// When the original value was a non-string JSON type (array, object, number, etc.),
// convert string results back to JsonNode to preserve the correct JSON type
// and prevent double-encoding when the block value is re-serialized.
if (result is string stringResult && value.IsNonStringJsonValue())
{
return stringResult.ConvertStringToExpandedJson() ?? result;
// return stringResult.ConvertToJsonNode() ?? result;
}

return result;
// revert this back to the old way - we don't expand the json we get back because umbraco is very
// sensitve to what the exact format of the blocks is, and if we expand them, then calls during render
// can return null.
return await _mapperCollection.Value.GetImportValueAsync(importString, propertyType, options);
}

private async Task<object?> GetExportProperty(object? value, IPropertyType? propertyType, SyncSerializerOptions options)
Expand Down
4 changes: 2 additions & 2 deletions uSync.History/history-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion uSync.History/history-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "usync-history-client",
"version": "17.3.3",
"version": "17.3.4",
"licence": "Custom",
"description": "uSync history function",
"type": "module",
Expand Down
Loading