Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from umco/develop
Browse files Browse the repository at this point in the history
Preparing v1.0.0 beta release
  • Loading branch information
leekelleher authored Apr 13, 2018
2 parents 2439c12 + ab3eff4 commit 0c5b3ab
Show file tree
Hide file tree
Showing 22 changed files with 541 additions and 338 deletions.
14 changes: 7 additions & 7 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
The MIT License (MIT)

Copyright © 2017 Lee Kelleher, Umbrella Inc and other contributors
Copyright © 2017 UMCO, Our Umbraco and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Expand Down
100 changes: 79 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
# Property List

A repeatable list (of selected datatype) for Umbraco.
[![Build status](https://img.shields.io/appveyor/ci/UMCO/umbraco-property-list.svg)](https://ci.appveyor.com/project/UMCO/umbraco-property-list)

## TODO
Property List is a property editor for making repeatable lists of a datatype for Umbraco 7.6+

## Getting Started

### Installation

> *Note:* Property List has been developed against **Umbraco v7.6.0** and will support that version and above.
Property List can be built manually from the source-code:

#### Manual build

If you prefer, you can compile Property List yourself, you'll need:

* Visual Studio 2017 (or above)

To clone it locally click the "Clone in Windows" button above or run the following git commands.

git clone https://github.com/umco/umbraco-property-list.git umbraco-property-list
cd umbraco-property-list
.\build.cmd

---

## Known Issues

* _[TBC]_

---

## Contributing to this project

Anyone and everyone is welcome to contribute. Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md).

* [Bug reports](CONTRIBUTING.md#bugs)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)

### TODO

What's left to do?

- [x] Pre Value Editor
- [x] Prevalues
Expand All @@ -20,43 +60,61 @@ A repeatable list (of selected datatype) for Umbraco.
- [x] Check if we can we reuse any Umbraco directives?
- [x] Check if any UMCO projects are useful for reuse?
- [x] CSS
- [ ] Angular / JS
- [x] Angular / JS
- [x] Prepare the value-editor
- [x] Get the DataType by ID; then get...
- [x] config/prevalues
- [x] view-path
- [x] property alias
- [x] Initialize the list values
- [x] Set the list values
- [ ] Set the IsDirty flag
- [x] Set the IsDirty flag
- [x] Render the DataType/property-editor
- [x] Repeatable
- [x] Addable
- [x] Removeable
- [x] Sortable
- [x] Saving the values
- [x] PropertyValueEditor
- [ ] ConvertDbToString
- [ ] ConvertDbToEditor
- [ ] ConvertEditorToDb
- [ ] Browser testing (Chrome, Firefox, IE/Edge)
- [x] ConvertDbToString
- [x] ConvertDbToEditor
- [x] ConvertEditorToDb
- [x] Browser testing (Chrome, Firefox, IE/Edge)

- [ ] PropertyValueConverter
- [ ] Get target DataType definition
- [ ] Create dummy PropertyType (in order to run the target property-editor's value-converter)
- [ ] Return as IEnumerable of that type
- [ ] Investigate ModelsBuilder support - think it's to provide the return type

- [ ] Packaging
- [ ] MSBuild script
- [ ] Umbraco package
- [ ] NuGet package
- [ ] AppVeyor
- [x] PropertyValueConverter
- [x] Get target DataType definition
- [x] Create dummy PropertyType (in order to run the target property-editor's value-converter)
- [x] Return as IEnumerable of that type
- [x] Investigate ModelsBuilder support - think it's to provide the return type

- [x] Packaging
- [x] MSBuild script
- [x] Umbraco package
- [x] NuGet package
- [x] AppVeyor

- [ ] Courier data-resolver
- [ ] Pre Value Editor
- [ ] Convert the DataType ID to the GUID
- [ ] Add DataType dependency
- [ ] Value Editor
- [ ] Convert the DataType ID to the GUID
- [ ] Processing all list item DataTypes


---

## Contact

Have a question?

* [Raise an issue](https://github.com/umco/umbraco-property-list/issues) on GitHub

## Dev Team

* [Lee Kelleher](https://github.com/leekelleher)
* [Matt Brailsford](https://github.com/mattbrailsford)

## License

Copyright © 2017 UMCO, Our Umbraco and [other contributors](https://github.com/umco/umbraco-property-list/graphs/contributors)

Licensed under the [MIT License](LICENSE.md)
17 changes: 11 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
image: Visual Studio 2017

# version format
version: 0.1.0.{build}
version: 1.0.0.{build}

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
init:
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta

cache:
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified

before_build:
- nuget restore src

build_script:
- build\build-appveyor.cmd
- build\build-appveyor.cmd

artifacts:
- path: artifacts\*.nupkg
Expand All @@ -19,8 +24,8 @@ artifacts:
deploy:
# MyGet Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/umbraco-packages/
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-packages
server: https://www.myget.org/F/umbraco-packages/api/v2/package
symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package
api_key:
secure: 36/Ax5O+e6wENlhoTwgvoEBZV3FG4XjF429SNTej2qsGTAL+cdfA1kT/tm1St8vx
artifact: /.*\.nupkg/
Expand All @@ -42,7 +47,7 @@ deploy:
- provider: NuGet
server:
api_key:
secure: eSLiOXbGVrxSG+X7PV6qTTUZ5VzS9EFj5+EufaWPfd+QXkF6gc8rZ4mGoHIVp/fL
secure: 0+oAleUTnr9UuJrhLW5rphRR+QGz00XX1Ui3k5kwyr2kUdEamiQ3F+gW0q8MJbDT
artifact: /.*\.nupkg/
on:
branch: master
Expand Down
5 changes: 3 additions & 2 deletions build/build-appveyor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ ECHO APPVEYOR_REPO_TAG: %APPVEYOR_REPO_TAG%
ECHO APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER%
ECHO APPVEYOR_BUILD_VERSION : %APPVEYOR_BUILD_VERSION%

CALL tools\NuGet.exe restore ..\src\Our.Umbraco.PropertyList.sln
CALL "%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" build\package.proj
CALL build\tools\NuGet.exe restore src\Our.Umbraco.PropertyList.sln
CALL "%programfiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MsBuild.exe" build\package.proj
REM CALL "%programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\MsBuild.exe" build\package.proj
8 changes: 4 additions & 4 deletions build/package.proj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<PropertyGroup>
<ProjectName>Our.Umbraco.PropertyList</ProjectName>
<PackageName>Property List</PackageName>
<MinUmbracoVersion>7.5.11</MinUmbracoVersion>
<Readme>Property List is a property editor for making repeatable lists of a datatype for Umbraco 7.5+</Readme>
<MinUmbracoVersion>7.6.0</MinUmbracoVersion>
<Readme>Property List is a property editor for making repeatable lists of a datatype for Umbraco 7.6+</Readme>
<AuthorName>Lee Kelleher, Matt Brailsford</AuthorName>
<AuthorUrl>https://github.com/umco/umbraco-property-list/graphs/contributors</AuthorUrl>
<PackageLicenseName>MIT license</PackageLicenseName>
Expand All @@ -33,7 +33,7 @@
<NuGetPackageName>Property List for Umbraco</NuGetPackageName>
<Copyright>Copyright &#169; 2017 UMCO, Our Umbraco and other contributors</Copyright>
<Owners>Lee Kelleher, Matt Brailsford</Owners>
<IconUrl></IconUrl>
<IconUrl>https://raw.githubusercontent.com/umco/umbraco-property-list/master/docs/img/logo.png</IconUrl>
<Tags>umbraco list editor</Tags>
<Language>en-GB</Language>
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
Expand Down Expand Up @@ -193,7 +193,7 @@
OutputDirectory="$(ArtifactsDir)"
Files="@(PackageFiles)" />

<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\src\.nuget\NuGet.exe"
<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(MSBuildProjectDirectory)\tools\NuGet.exe"
ManifestFile="$(BuildNuGetDir)\package.nuspec"
BasePath="$(BuildNuGetDir)"
Version="$(ProductVersion)"
Expand Down
Binary file added docs/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/logo.psd
Binary file not shown.
7 changes: 5 additions & 2 deletions src/Our.Umbraco.PropertyList.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.PropertyList", "Our.Umbraco.PropertyList\Our.Umbraco.PropertyList.csproj", "{3A156991-6196-48CC-80C8-42C49B1AC06F}"
EndProject
Expand Down Expand Up @@ -40,4 +40,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{02D2DC50-BF81-4ACB-8EE4-1D626733834F} = {75F0130A-1048-4D1A-B922-FB6916004BC4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DDD2E97D-CC58-4450-B20B-0EBB22B4D910}
EndGlobalSection
EndGlobal
38 changes: 21 additions & 17 deletions src/Our.Umbraco.PropertyList/Bootstrap.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
using Umbraco.Core;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Newtonsoft.Json;
using Our.Umbraco.PropertyList.Converters;
using Umbraco.Core;
using Umbraco.Core.Sync;
using Umbraco.Web.Cache;

namespace Our.Umbraco.PropertyList
{
public class Bootstrap : ApplicationEventHandler
{
private CacheHelper _applicationCache;

protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
_applicationCache = applicationContext.ApplicationCache;

DataTypeService.Saved += DataTypeService_Saved;
}
DataTypeCacheRefresher.CacheUpdated += (sender, e) =>
{
if (e.MessageType != MessageType.RefreshByJson)
return;

private void DataTypeService_Saved(IDataTypeService sender, SaveEventArgs<IDataTypeDefinition> e)
{
var cacheKeyPrefix = "Our.Umbraco.PropertyList.PropertyListValueConverter.GetInnerPublishedPropertyType_";
// NOTE: The properties for the JSON payload are available here: (Currently there isn't a public API to deserialize the payload)
// https://github.com/umbraco/Umbraco-CMS/blob/release-7.6.0/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs#L66-L70
// TODO: Once `DataTypeCacheRefresher.DeserializeFromJsonPayload` is public, we can deserialize correctly.
// https://github.com/umbraco/Umbraco-CMS/blob/release-7.6.0/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs#L27
var payload = JsonConvert.DeserializeAnonymousType((string)e.MessageObject, new[] { new { Id = default(int) } });
if (payload == null)
return;

foreach (var dataType in e.SavedEntities)
{
_applicationCache.RuntimeCache.ClearCacheByKeySearch(string.Concat(cacheKeyPrefix, dataType.Id));
}
foreach (var item in payload)
{
PropertyListValueConverter.ClearDataTypeCache(item.Id);
}
};
}
}
}
Loading

0 comments on commit 0c5b3ab

Please sign in to comment.