-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #395 from leekelleher/dev/v4.x
Preparing v4.7.0 release
- Loading branch information
Showing
45 changed files
with
500 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.6.1 | ||
4.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Umbraco.Cms.10.x/uSync/v10/DataTypes/ContentmentDataPickerWebUCssClassName.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<DataType Key="d4b190f2-e2a6-470c-a39f-8e1ae14d521c" Alias="[Contentment] Data Picker - Web uCssClassName" Level="2"> | ||
<Info> | ||
<Name>[Contentment] Data Picker - Web uCssClassName</Name> | ||
<EditorAlias>Umbraco.Community.Contentment.DataPicker</EditorAlias> | ||
<DatabaseType>Ntext</DatabaseType> | ||
<Folder>Test+Data+Picker</Folder> | ||
</Info> | ||
<Config><![CDATA[{ | ||
"dataSource": [ | ||
{ | ||
"key": "Umbraco.Community.Contentment.DataEditors.uCssClassNameDataListSource, Umbraco.Community.Contentment", | ||
"value": { | ||
"cssPath": "~/umbraco/lib/font-awesome/css/font-awesome.min.css", | ||
"cssRegex": "\\.fa-([^:]*?):before", | ||
"excludeList": "", | ||
"iconPattern": "icon-fa fa-{0}" | ||
} | ||
} | ||
], | ||
"displayMode": [ | ||
{ | ||
"key": "Umbraco.Community.Contentment.DataEditors.CardsDataPickerDisplayMode, Umbraco.Community.Contentment", | ||
"value": null | ||
} | ||
], | ||
"pageSize": 12, | ||
"overlaySize": [ | ||
"medium" | ||
], | ||
"hideSearch": "0", | ||
"maxItems": 0, | ||
"enableDevMode": "1" | ||
}]]></Config> | ||
</DataType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Umbraco.Cms.13.x/uSync/v9/DataTypes/ContentmentDataPickerWebUCssClassName.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<DataType Key="882e9021-789a-412c-ac26-9818df51c647" Alias="[Contentment] Data Picker - Web uCssClassName" Level="2"> | ||
<Info> | ||
<Name>[Contentment] Data Picker - Web uCssClassName</Name> | ||
<EditorAlias>Umbraco.Community.Contentment.DataPicker</EditorAlias> | ||
<DatabaseType>Ntext</DatabaseType> | ||
<Folder>Test+Data+Picker</Folder> | ||
</Info> | ||
<Config><![CDATA[{ | ||
"dataSource": [ | ||
{ | ||
"key": "Umbraco.Community.Contentment.DataEditors.uCssClassNameDataListSource, Umbraco.Community.Contentment", | ||
"value": { | ||
"cssPath": "~/umbraco/lib/font-awesome/css/font-awesome.min.css", | ||
"cssRegex": "\\.fa-([^:]*?):before", | ||
"excludeList": "", | ||
"iconPattern": "icon-fa fa-{0}" | ||
} | ||
} | ||
], | ||
"displayMode": [ | ||
{ | ||
"key": "Umbraco.Community.Contentment.DataEditors.CardsDataPickerDisplayMode, Umbraco.Community.Contentment", | ||
"value": {} | ||
} | ||
], | ||
"pageSize": 12, | ||
"overlaySize": [ | ||
"medium" | ||
], | ||
"hideSearch": "0", | ||
"maxItems": 0, | ||
"enableDevMode": "1" | ||
}]]></Config> | ||
</DataType> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...ommunity.Contentment/DataEditors/DataList/DataSources/DataListToDataPickerSourceBridge.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* Copyright © 2024 Lee Kelleher. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
#if NET472 | ||
using Umbraco.Core; | ||
using Umbraco.Core.Models; | ||
using Umbraco.Core.PropertyEditors; | ||
#else | ||
using Umbraco.Cms.Core.Models; | ||
using Umbraco.Cms.Core.PropertyEditors; | ||
using Umbraco.Extensions; | ||
#endif | ||
|
||
namespace Umbraco.Community.Contentment.DataEditors | ||
{ | ||
public abstract class DataListToDataPickerSourceBridge : IDataListSource, IDataPickerSource | ||
{ | ||
public abstract string Name { get; } | ||
|
||
public abstract string Description { get; } | ||
|
||
public abstract string Icon { get; } | ||
|
||
public abstract string Group { get; } | ||
|
||
public abstract IEnumerable<ConfigurationField> Fields { get; } | ||
|
||
public abstract Dictionary<string, object> DefaultValues { get; } | ||
|
||
public abstract OverlaySize OverlaySize { get; } | ||
|
||
public abstract IEnumerable<DataListItem> GetItems(Dictionary<string, object> config); | ||
|
||
public virtual Task<IEnumerable<DataListItem>> GetItemsAsync(Dictionary<string, object> config, IEnumerable<string> values) | ||
{ | ||
var items = GetItems(config); | ||
|
||
if (items?.Any() == true) | ||
{ | ||
return Task.FromResult(items.Where(x => values.Contains(x.Value) == true)); | ||
} | ||
|
||
return Task.FromResult(Enumerable.Empty<DataListItem>()); | ||
} | ||
|
||
public virtual Task<PagedResult<DataListItem>> SearchAsync(Dictionary<string, object> config, int pageNumber = 1, int pageSize = 12, string query = "") | ||
{ | ||
var items = default(IEnumerable<DataListItem>); | ||
|
||
if (string.IsNullOrWhiteSpace(query) == true) | ||
{ | ||
items = GetItems(config); | ||
} | ||
else | ||
{ | ||
items = GetItems(config)?.Where(x => x.Name?.InvariantContains(query) == true || x.Value?.InvariantStartsWith(query) == true); | ||
} | ||
|
||
if (items?.Any() == true) | ||
{ | ||
var offset = (pageNumber - 1) * pageSize; | ||
return Task.FromResult(new PagedResult<DataListItem>(items.Count(), pageNumber, pageSize) | ||
{ | ||
Items = items.Skip(offset).Take(pageSize), | ||
}); | ||
} | ||
|
||
return Task.FromResult(new PagedResult<DataListItem>(-1, pageNumber, pageSize)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.