Skip to content

Commit

Permalink
Release 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bverdonck committed Feb 28, 2021
1 parent 05b42e0 commit 577ad7f
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 76 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Note that the nuget package only contains the Sitecore Forms Extensions codebase

## Compatibility 🧩

- For Sitecore 10 use version 3.1
- For Sitecore 9.3+ use version 3.1
- For Sitecore 10 use version 3.2
- For Sitecore 9.3 use version 3.2
- For Sitecore 9.1.x till 9.2.x use version 2.3.1
- For Sitecore 9.0.x use version 1.8.3

Expand Down Expand Up @@ -83,6 +83,12 @@ Want to contribute to SFE? Great! This section will explain how to setup the pro
When adding new functionality to the codebase, please add a test-form in the sitecore content tree (/sitecore/Forms). Also, add a page of the template `/sitecore/templates/Project/FormsExtensionsTester/Pages/ContentPage` in the test-website, referencing the form containing the test of the functionality.

## Changelog 📜
### 3.2 (for Sitecore 9.3 and Sitecore 10)
- Fix: Store back checkbox on certain field types was missing.
- Fix: Null check in StringValueFromStringListInputViewModelReader
- Fix: Combining multiple date validators caused error
- Fix: Model types on list components was incorrect

### 3.1 (for Sitecore 9.3 and Sitecore 10)
- *Subscribe to list*: New submit action, to add the current contact to a selectable list. Possible to limit action on a checkbox in the form that needs to be checked.
- *Send Email*:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<services>
<configurator type= "Feature.FormsExtensions.FormsComponentConfigurator, Feature.FormsExtensions"/>
<configurator type="Feature.FormsExtensions.FormsComponentConfigurator, Feature.FormsExtensions"/>
<register serviceType="Feature.FormsExtensions.XDb.IXDbContactFactory, Feature.FormsExtensions" implementationType="Feature.FormsExtensions.XDb.FormsExtensionsXDbContactFactory, Feature.FormsExtensions" lifetime="Singleton" />
</services>

<!--
Adding DI for ListManagement services as SubscribeToListAction requires it (ISubscriptionService)
By default this is disabled for ContentDelivery role (vanilla config Sitecore.ListManagement.Services.config)
-->
<configurator type="Sitecore.ListManagement.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement"
role:require="ContentDelivery" />
<configurator type="Sitecore.ListManagement.XConnect.Web.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement.XConnect.Web"
role:require="ContentDelivery" />
<configurator type="Sitecore.ListManagement.Services.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement.Services"
role:require="ContentDelivery" />
</services>
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -57,45 +57,53 @@ $.validator.addMethod("filesize", function (value, element, maxfilesize) {
});

// Date Time Span Validator
["timespan", "tsminagedate", "tsfuturedate", "tspastdate"].forEach(validationType =>{
$.validator.unobtrusive.adapters.add(validationType, ['min', 'max', 'unit'], function(options) {
options.rules[validationType] = [options.params.min, options.params.max, options.params.unit];
options.messages[validationType] = options.message;
});

$.validator.addMethod(validationType, function (value, element, params) {
if (!this.optional(element)) {
var unit = params[2];
var minvalue = params[0];
var maxvalue = params[1];

var valueToValidate = 0;

switch (unit) {
case 'days':
valueToValidate = getDays(value);
break;
case 'months':
valueToValidate = getMonths(value);
break;
case 'years':
valueToValidate = getYears(value);
break;
}

var isValid = true;

if (typeof minvalue !== 'undefined' && valueToValidate < minvalue)
isValid = false;

if (typeof maxvalue !== 'undefined' && valueToValidate > maxvalue)
isValid = false;

return isValid;
}
return true;
});
})

/*
$.validator.unobtrusive.adapters.add('timespan', ['min', 'max', 'unit'], function(options) {
options.rules['timespan'] = [options.params.min, options.params.max, options.params.unit];
options.messages['timespan'] = options.message;
});

$.validator.addMethod("timespan", function (value, element, params) {
if (!this.optional(element)) {
var unit = params[2];
var minvalue = params[0];
var maxvalue = params[1];

var valueToValidate = 0;

switch (unit) {
case 'days':
valueToValidate = getDays(value);
break;
case 'months':
valueToValidate = getMonths(value);
break;
case 'years':
valueToValidate = getYears(value);
break;
}

var isValid = true;

if (typeof minvalue !== 'undefined' && valueToValidate < minvalue)
isValid = false;

if (typeof maxvalue !== 'undefined' && valueToValidate > maxvalue)
isValid = false;

return isValid;
}
return true;
});
$.validator.addMethod("timespan", timespanValidatorFunction);*/

function getDays(date) {
var today = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<services>
<configurator type= "Feature.FormsExtensions.FormsComponentConfigurator, Feature.FormsExtensions"/>
<configurator type="Feature.FormsExtensions.FormsComponentConfigurator, Feature.FormsExtensions"/>
<register serviceType="Feature.FormsExtensions.XDb.IXDbContactFactory, Feature.FormsExtensions" implementationType="Feature.FormsExtensions.XDb.FormsExtensionsXDbContactFactory, Feature.FormsExtensions" lifetime="Singleton" />
</services>

<!--
Adding DI for ListManagement services as SubscribeToListAction requires it (ISubscriptionService)
By default this is disabled for ContentDelivery role (vanilla config Sitecore.ListManagement.Services.config)
-->
<configurator type="Sitecore.ListManagement.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement"
role:require="ContentDelivery" />
<configurator type="Sitecore.ListManagement.XConnect.Web.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement.XConnect.Web"
role:require="ContentDelivery" />
<configurator type="Sitecore.ListManagement.Services.DependencyInjection.CustomServiceConfigurator, Sitecore.ListManagement.Services"
role:require="ContentDelivery" />
</services>
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -57,45 +57,53 @@ $.validator.addMethod("filesize", function (value, element, maxfilesize) {
});

// Date Time Span Validator
["timespan", "tsminagedate", "tsfuturedate", "tspastdate"].forEach(validationType =>{
$.validator.unobtrusive.adapters.add(validationType, ['min', 'max', 'unit'], function(options) {
options.rules[validationType] = [options.params.min, options.params.max, options.params.unit];
options.messages[validationType] = options.message;
});

$.validator.addMethod(validationType, function (value, element, params) {
if (!this.optional(element)) {
var unit = params[2];
var minvalue = params[0];
var maxvalue = params[1];

var valueToValidate = 0;

switch (unit) {
case 'days':
valueToValidate = getDays(value);
break;
case 'months':
valueToValidate = getMonths(value);
break;
case 'years':
valueToValidate = getYears(value);
break;
}

var isValid = true;

if (typeof minvalue !== 'undefined' && valueToValidate < minvalue)
isValid = false;

if (typeof maxvalue !== 'undefined' && valueToValidate > maxvalue)
isValid = false;

return isValid;
}
return true;
});
})

/*
$.validator.unobtrusive.adapters.add('timespan', ['min', 'max', 'unit'], function(options) {
options.rules['timespan'] = [options.params.min, options.params.max, options.params.unit];
options.messages['timespan'] = options.message;
});

$.validator.addMethod("timespan", function (value, element, params) {
if (!this.optional(element)) {
var unit = params[2];
var minvalue = params[0];
var maxvalue = params[1];

var valueToValidate = 0;

switch (unit) {
case 'days':
valueToValidate = getDays(value);
break;
case 'months':
valueToValidate = getMonths(value);
break;
case 'years':
valueToValidate = getYears(value);
break;
}

var isValid = true;

if (typeof minvalue !== 'undefined' && valueToValidate < minvalue)
isValid = false;

if (typeof maxvalue !== 'undefined' && valueToValidate > maxvalue)
isValid = false;

return isValid;
}
return true;
});
$.validator.addMethod("timespan", timespanValidatorFunction);*/

function getDays(date) {
var today = new Date();
Expand Down
Binary file modified docker/build/module/db/Sitecore.core.dacpac
Binary file not shown.
Binary file modified docker/build/module/db/Sitecore.master.dacpac
Binary file not shown.
Binary file modified docker/build/module/db/Sitecore.web.dacpac
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions sitecorepackagedefinition/Sitecore Forms Extensions.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<project>
<Metadata>
<metadata>
<PackageName>Sitecore Forms Extensions for SC9.3 and SC10</PackageName>
<PackageName>Sitecore Forms Extensions for SC9.3 and SC10.0</PackageName>
<Author>Bart Verdonck</Author>
<Version>3.1</Version>
<Version>3.2</Version>
<Revision />
<License />
<Comment />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>SitecoreFormsExtensions.Core</id>
<version>3.1.0</version>
<version>3.2.0</version>
<title>$title$</title>
<authors>Bart Verdonck</authors>
<owners>$author$</owners>
Expand All @@ -11,7 +11,7 @@
<projectUrl>https://github.com/bartverdonck/Sitecore-Forms-Extensions/</projectUrl>
<description>Sitecore Forms Extensions is a module to enrich the default Sitecore Forms module. This library does not intall the module, it only provides the classes and interfaces to extends on Sitecore Forms Extentions.</description>
<releaseNotes>Initial Verion</releaseNotes>
<copyright>Copyright 2020</copyright>
<copyright>Copyright 2021</copyright>
<tags>sitecore forms</tags>
<icon>images\icon.png</icon>
<iconUrl>https://raw.githubusercontent.com/bartverdonck/Sitecore-Forms-Extensions/master/docs/Sitecore-Forms-Extensions-Logo.png</iconUrl>
Expand Down

0 comments on commit 577ad7f

Please sign in to comment.