Skip to content

Commit

Permalink
Merge pull request #3529 from 2sic/develop
Browse files Browse the repository at this point in the history
release 19.00
  • Loading branch information
iJungleboy authored Dec 21, 2024
2 parents 1fbe056 + db85b99 commit fd7c24e
Show file tree
Hide file tree
Showing 75 changed files with 928 additions and 524 deletions.
1 change: 1 addition & 0 deletions Src/2sxc Multi-Target.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=fallbacks/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Guids/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Imageflow/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inetpub/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inheritdoc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=initializers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inpage/@EntryIndexedValue">True</s:Boolean>
Expand Down
156 changes: 114 additions & 42 deletions Src/Data/App_Data/system/bundles/system-fields-pickers.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Src/Dnn/ToSic.Sxc.Dnn.Core/Dnn/Cms/DnnPagePublishing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
using ToSic.Eav.Cms.Internal;
using ToSic.Eav.Context;
using ToSic.Eav.Data;
using ToSic.Eav.DataSource;
using ToSic.Eav.DataSource.Internal;
using ToSic.Sxc.Blocks.Internal;
using ToSic.Sxc.Cms.Internal.Publishing;
using ToSic.Sxc.Context.Internal;
using ToSic.Sxc.Data.Internal.Decorators;
using ToSic.Sxc.DataSources;
using ToSic.Sxc.Dnn.Context;
using ToSic.Sxc.Dnn.Run;

Expand Down Expand Up @@ -133,7 +133,7 @@ public void Publish(int instanceId, int version)

}

private IEnumerable<IEntity> TryToAddStream(IEnumerable<IEntity> list, IBlockInstance data, string key)
private IEnumerable<IEntity> TryToAddStream(IEnumerable<IEntity> list, IDataSource data, string key)
{
var cont = data.GetStream(key, nullIfNotFound: true)?.List.ToImmutableList(); // data.Out.ContainsKey(key) ? data[key]?.List?.ToImmutableList() : null;
Log.A($"TryToAddStream(..., ..., key:{key}), found:{cont != null} add⋮{cont?.Count ?? 0}" );
Expand Down
8 changes: 2 additions & 6 deletions Src/Dnn/ToSic.Sxc.Dnn.Razor/Custom/Hybrid/RazorTyped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using ToSic.Sxc.Code.Internal.CodeErrorHelp;
using ToSic.Sxc.Code.Internal.CodeRunHelpers;
using ToSic.Sxc.Data;
using ToSic.Sxc.DataSources;
using ToSic.Sxc.Dnn.Razor;
using ToSic.Sxc.Dnn.Razor.Internal;
using ToSic.Sxc.Engines;
Expand Down Expand Up @@ -55,10 +54,7 @@ public TService GetService<TService>(NoParamOrder protector = default, string ty
internal TypedCode16Helper CodeHelper => _codeHelper ??= CreateCodeHelper();
private TypedCode16Helper _codeHelper;

/// <summary>
/// BETA! v17.03+
/// </summary>
[WorkInProgressApi("Experiment v17.03+")]
/// <inheritdoc cref="CodeTyped.Customize"/>
protected ICodeCustomizer Customize => _customize ??= _CodeApiSvc.GetService<ICodeCustomizer>(reuse: true);
private ICodeCustomizer _customize;

Expand Down Expand Up @@ -129,7 +125,7 @@ public dynamic GetCode(string path, NoParamOrder noParamOrder = default, string
public ITypedItem MyHeader => CodeHelper.MyHeader;

/// <inheritdoc />
public IBlockInstance MyData => _CodeApiSvc.Data;
public IDataSource MyData => _CodeApiSvc.Data;

/// <inheritdoc />
public ITypedModel MyModel => CodeHelper.MyModel;
Expand Down
4 changes: 2 additions & 2 deletions Src/Dnn/ToSic.Sxc.Dnn.WebApi/Custom/Hybrid/ApiTyped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
using ToSic.Sxc.Context;
using System.IO;
using System.Web.Http.Results;
using ToSic.Eav.DataSource;
using ToSic.Eav.WebApi;
using ToSic.Lib.Coding;
using ToSic.Sxc.Adam;
using ToSic.Sxc.Code.Internal;
using ToSic.Sxc.Code.Internal.CodeRunHelpers;
using ToSic.Sxc.DataSources;
using ToSic.Sxc.Dnn.WebApi.Internal.Compatibility;
using ToSic.Sxc.Internal;

Expand Down Expand Up @@ -181,7 +181,7 @@ private TypedCode16Helper CreateCodeHelper()
public ITypedItem MyHeader => CodeHelper.MyHeader;

/// <inheritdoc />
public IBlockInstance MyData => _CodeApiSvc.Data;
public IDataSource MyData => _CodeApiSvc.Data;

#endregion

Expand Down
2 changes: 1 addition & 1 deletion Src/Dnn/ToSic.Sxc.Dnn/DnnPackageBuilder/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<dl>
<dt>v18.06.01</dt>
<dt>v19.00.00</dt>
<dd>Part of module installation is the deletion of unneeded data. In an infrequent case, You could get a
timeout exception. This is not a show-stopper. Simply reload the page so DNN can continue clean-up
until all unnecessary data is deleted and the module is installed.</dd>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- make sure sql rolls back automatically in case of error.
SET XACT_ABORT ON
GO

-- Drop the existing foreign key constraint
ALTER TABLE [dbo].[ToSIC_EAV_EntityRelationships]
DROP CONSTRAINT IF EXISTS [FK_ToSIC_EAV_EntityRelationships_ToSIC_EAV_Attributes];
GO

-- Add the foreign key constraint with ON DELETE CASCADE
ALTER TABLE [dbo].[ToSIC_EAV_EntityRelationships]
ADD CONSTRAINT [FK_ToSIC_EAV_EntityRelationships_ToSIC_EAV_Attributes]
FOREIGN KEY ([AttributeID])
REFERENCES [dbo].[ToSIC_EAV_Attributes] ([AttributeID])
ON UPDATE NO ACTION
ON DELETE CASCADE;
GO
13 changes: 9 additions & 4 deletions Src/Dnn/ToSic.Sxc.Dnn/DnnPackageBuilder/ToSic.Sxc.Dnn.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="2SexyContent" type="Module" version="18.06.01">
<package name="2SexyContent" type="Module" version="19.00.00">
<friendlyName> Content</friendlyName>
<description>2sxc is a DNN Extension to create attractive and designed content. It solves the common problem, allowing the web designer to create designed templates for different content elements, so that the user must only fill in fields and receive a perfectly designed and animated output.</description>
<iconFile>icon.png</iconFile>
Expand Down Expand Up @@ -71,10 +71,15 @@
<name>18.03.00.SqlDataProvider</name>
<version>18.03.00</version>
</script>
<script type="Install">
<path>SqlDataProvider</path>
<name>19.00.00.SqlDataProvider</name>
<version>19.00.00</version>
</script>
<script type="UnInstall">
<path>SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>18.06.01</version>
<version>19.00.00</version>
</script>
</scripts>
</component>
Expand Down Expand Up @@ -125,7 +130,7 @@
<businessControllerClass>ToSic.SexyContent.DnnBusinessController</businessControllerClass>
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
<!-- This must contain all versions which have upgrade-code. By convention, we also add the main entry versions, even if no upgrade code exists for them -->
<upgradeVersionsList>01.00.00,08.11.00,08.12.00,09.00.00,10.00.00,11.00.00,12.00.00,13.00.00,13.01.00,13.04.00,14.00.00,15.00.00,15.02.00,16.00.00,16.07.01,17.00.00,18.00.00,18.06.01</upgradeVersionsList>
<upgradeVersionsList>01.00.00,08.11.00,08.12.00,09.00.00,10.00.00,11.00.00,12.00.00,13.00.00,13.01.00,13.04.00,14.00.00,15.00.00,15.02.00,16.00.00,16.07.01,17.00.00,18.00.00,18.03.00,19.00.00</upgradeVersionsList>
</attributes>
</eventMessage>
</component>
Expand Down Expand Up @@ -632,7 +637,7 @@
</components>
</package>

<package name="2SexyContent-App" type="Module" version="18.06.01">
<package name="2SexyContent-App" type="Module" version="19.00.00">
<friendlyName> App</friendlyName>
<description>2sxc App is an extension that allows to install and use a 2sxc app.</description>
<iconFile>icon-app.png</iconFile>
Expand Down
1 change: 1 addition & 0 deletions Src/Dnn/ToSic.Sxc.Dnn/ToSic.Sxc.Dnn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<Content Include="DnnPackageBuilder\SqlDataProvider\15.00.00.SqlDataProvider" />
<Content Include="DnnPackageBuilder\SqlDataProvider\16.07.01.SqlDataProvider" />
<Content Include="DnnPackageBuilder\SqlDataProvider\18.03.00.SqlDataProvider" />
<Content Include="DnnPackageBuilder\SqlDataProvider\19.00.00.SqlDataProvider" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="web.config" />
<None Include="web.Debug.config">
Expand Down
5 changes: 3 additions & 2 deletions Src/Oqtane/ToSic.Sxc.Oqt.Client/Content/ModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ public class ModuleInfo : IModule
* 15-00-00 - SQL - updates for DataTimeline table
* ...
* 16-07-01 - SQL - add Json for Attribute and ContentType configuration + Guid for Attribute
* 18-02-01 - SQL - remove AttributeGroups SQL table and related
* 18-03-00 - SQL - remove AttributeGroups SQL table and related
* 18-07-00 - SQL - CASCADE DELETE on REFERENCE constraint FK_ToSIC_EAV_EntityRelationships_ToSIC_EAV_Attributes
*/

/// <summary>
/// The SQL versions must use a "-" to avoid being replaced on search/replace when releasing a new version.
/// When SQL script is added in new version, include new version explicitly in this array.
/// </summary>
internal static string[] SqlScriptVersions = ["0-0-1", "12-00-00", "12-02-01", "12-05-00", "13-00-00", "13-01-00", "15-00-00", "16-07-01", "18-03-00"];
internal static string[] SqlScriptVersions = ["0-0-1", "12-00-00", "12-02-01", "12-05-00", "13-00-00", "13-01-00", "15-00-00", "16-07-01", "18-03-00", "18-07-00"];

/// <summary>
/// Merge versions for use in Oqtane version list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>ToSic.Sxc.Oqtane.Install</id>
<version>18.06.01</version>
<version>19.00.00</version>
<authors>2sic internet solutions GmbH, Switzerland</authors>
<owners>2sic internet solutions GmbH, Switzerland</owners>
<title>2sxc CMS and Meta-Module for Oqtane</title>
Expand Down
11 changes: 4 additions & 7 deletions Src/Oqtane/ToSic.Sxc.Oqt.Server/Custom/Hybrid/ApiTyped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
using System.IO;
using ToSic.Sxc.Adam;
using Microsoft.AspNetCore.Mvc.Filters;
using ToSic.Eav.DataSource;
using ToSic.Lib.Coding;
using ToSic.Sxc.Code.Internal;
using ToSic.Sxc.Code.Internal.CodeRunHelpers;
using ToSic.Sxc.DataSources;
using ToSic.Sxc.Internal;

// ReSharper disable once CheckNamespace
Expand Down Expand Up @@ -127,7 +127,7 @@ public IFile SaveInAdam(NoParamOrder noParamOrder = default,

public ITypedItem MyHeader => CodeHelper.MyHeader;

public IBlockInstance MyData => _CodeApiSvc.Data;
public IDataSource MyData => _CodeApiSvc.Data;

#endregion

Expand Down Expand Up @@ -228,12 +228,9 @@ public IEnumerable<T> AsList<T>(object source, NoParamOrder protector = default,

#endregion

#region Customize new WIP v17
#region Customize

/// <summary>
/// WIP
/// </summary>
[PrivateApi("Experiment v17.02+")]
/// <inheritdoc cref="CodeTyped.Customize"/>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
protected ICodeCustomizer Customize => _customize ??= _CodeApiSvc.GetService<ICodeCustomizer>(reuse: true);
private ICodeCustomizer _customize;
Expand Down
21 changes: 21 additions & 0 deletions Src/Oqtane/ToSic.Sxc.Oqt.Server/Scripts/ToSic.Sxc.19.00.00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- make sure sql rolls back automatically in case of error.
SET XACT_ABORT ON
GO

-- Drop the existing foreign key constraint
ALTER TABLE [dbo].[ToSIC_EAV_EntityRelationships]
DROP CONSTRAINT IF EXISTS [FK_ToSIC_EAV_EntityRelationships_ToSIC_EAV_Attributes];
GO

-- Add the foreign key constraint with ON DELETE CASCADE
ALTER TABLE [dbo].[ToSIC_EAV_EntityRelationships]
ADD CONSTRAINT [FK_ToSIC_EAV_EntityRelationships_ToSIC_EAV_Attributes]
FOREIGN KEY ([AttributeID])
REFERENCES [dbo].[ToSIC_EAV_Attributes] ([AttributeID])
ON UPDATE NO ACTION
ON DELETE CASCADE;
GO
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using ToSic.Sxc.Oqt.Shared.Helpers;
using ToSic.Sxc.Oqt.Shared.Interfaces;
using ToSic.Sxc.Oqt.Shared.Models;
using ToSic.Sxc.Services.Internal;

namespace ToSic.Sxc.Oqt.Server.Services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<EmbeddedResource Include="Scripts\ToSic.Sxc.15.00.00.sql" />
<EmbeddedResource Include="Scripts\ToSic.Sxc.16.07.01.sql" />
<EmbeddedResource Include="Scripts\ToSic.Sxc.18.03.00.sql" />
<EmbeddedResource Include="Scripts\ToSic.Sxc.19.00.00.sql" />
<EmbeddedResource Include="Scripts\ToSic.Sxc.Uninstall.sql" />
</ItemGroup>

Expand Down
15 changes: 6 additions & 9 deletions Src/Razor/ToSic.Sxc.Razor/Custom.Hybrid/RazorTyped_TModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using ToSic.Eav.Code.Help;
using ToSic.Eav.Data;
using ToSic.Eav.DataSource;
using ToSic.Lib.Coding;
using ToSic.Lib.Documentation;
using ToSic.Lib.Helpers;
Expand All @@ -16,7 +17,6 @@
using ToSic.Sxc.Code.Internal.CodeRunHelpers;
using ToSic.Sxc.Context;
using ToSic.Sxc.Data;
using ToSic.Sxc.DataSources;
using ToSic.Sxc.Engines;
using ToSic.Sxc.Internal;
using ToSic.Sxc.Razor.Internal;
Expand Down Expand Up @@ -73,7 +73,7 @@ public abstract class RazorTyped<TModel>()

public ITypedItem MyHeader => CodeHelper.MyHeader;

public IBlockInstance MyData => _CodeApiSvc.Data;
public IDataSource MyData => _CodeApiSvc.Data;

#endregion

Expand Down Expand Up @@ -182,24 +182,21 @@ public IEnumerable<T> AsList<T>(object source, NoParamOrder protector = default,
#region WIP v17

/// <summary>
/// EXPERIMENTAL support razor base class with typed model
/// Typed Model of a Razor with typed model
/// </summary>
/// <returns></returns>
/// <remarks>
/// Introduced (beta) in v17.03
/// * Introduced in v17.03 (beta)
/// * Stable since v18.00
/// </remarks>
[PrivateApi("WIP, don't publish yet")]
public new TModel Model => CodeHelper.GetModel<TModel>();

/// <summary>
/// WIP
/// </summary>
[PrivateApi("Experiment v17.02+")]
/// <inheritdoc cref="CodeTyped.Customize"/>
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
protected ICodeCustomizer Customize => _customize ??= _CodeApiSvc.GetService<ICodeCustomizer>(reuse: true);
private ICodeCustomizer _customize;


#endregion

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ToSic.Sxc.Edit.Toolbar.Internal;
using static ToSic.Sxc.Edit.Toolbar.ToolbarConstants;

namespace ToSic.Sxc.Tests.ServicesTests.ToolbarService;
Expand Down Expand Up @@ -33,6 +32,13 @@ public void Parameters1String()
public void Parameters2Strings()
=> AssertParams(["Hello=World"], NewTb().TacParameters("Hello", "World"));

[TestMethod]
public void Parameters2Int()
=> AssertParams(["Hello=42"], NewTb().TacParameters("Hello", 42));
[TestMethod]
public void Parameters2Bool()
=> AssertParams(["Hello=true"], NewTb().TacParameters("Hello", true));

[TestMethod]
public void Parameters1ObjectA()
=> AssertParams([new { hello = "world" }], NewTb().TacParameters(new { hello = "world"}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,19 @@

namespace ToSic.Sxc.WebApi;

/// <summary>
/// An ActionFilter attribute that automatically decrypts encrypted POST payloads for Web API endpoints.
/// Apply this attribute to a controller or action method to seamlessly handle encrypted incoming POST requests,
/// ensuring the decrypted data is available for processing within the action method.
/// </summary>
/// <remarks>
/// This attribute intercepts POST requests with JSON content, checks for encrypted data,
/// and if present, decrypts the payload using the <see cref="AesHybridCryptographyService"/>.
/// It then deserializes the decrypted data into the expected parameter type and replaces the action arguments.
/// If the payload is not encrypted, the request content remains unchanged.
/// * Introduced in version 18.05.
/// </remarks>
[PublicApi]
[PrivateApi]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class SecureEndpointAttribute : ActionFilterAttribute
{
private const string MediaType = "application/json";

[PrivateApi]
public SecureEndpointAttribute()
{
Order = -3002;
}

[PrivateApi]
public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
var request = context.HttpContext.Request;
Expand Down
Loading

0 comments on commit fd7c24e

Please sign in to comment.