Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 0ac8792

Browse files
committed
Merge pull request #46 from leekelleher/develop
Release 0.2.1
2 parents 56ecab3 + 3b1d9f0 commit 0ac8792

File tree

12 files changed

+130
-45
lines changed

12 files changed

+130
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _ReSharper.*
99
Thumbs.db
1010
.DS_Store
1111
*.log
12+
.vs
1213

1314
artifacts/
1415
src/packages/*/**

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ Guidelines for bug reports:
3636
2. **Check if the issue has been fixed** — try to reproduce it using the
3737
latest `master` or development branch in the repository.
3838

39-
3. **Isolate the problem** — create a [reduced test
40-
case](http://css-tricks.com/6263-reduced-test-cases/) and a live example.
39+
3. **Isolate the problem** — create a reduced test case and a live example.
4140

4241
A good bug report shouldn't leave others needing to chase you up for more
4342
information. Please try to be as detailed as possible in your report. What is

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Doc Type Grid Editor
22

33
[![Build status](https://img.shields.io/appveyor/ci/leekelleher/umbraco-doc-type-grid-editor.svg)](https://ci.appveyor.com/project/leekelleher/umbraco-doc-type-grid-editor)
4+
[![NuGet release](https://img.shields.io/nuget/v/Our.Umbraco.DocTypeGridEditor.svg)](https://www.nuget.org/packages/Our.Umbraco.DocTypeGridEditor)
45
[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)
56
[![Chat on Gitter](https://img.shields.io/badge/gitter-join_chat-green.svg)](https://gitter.im/leekelleher/umbraco-doc-type-grid-editor)
67

@@ -20,7 +21,15 @@ Doc Type Grid Editor can be installed from either Our Umbraco package repository
2021

2122
To install from Our Umbraco, please download the package from:
2223

23-
> [https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)
24+
> [https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)
25+
26+
#### NuGet package repository
27+
28+
To [install from NuGet](https://www.nuget.org/packages/Our.Umbraco.DocTypeGridEditor), you can run the following command from within Visual Studio:
29+
30+
PM> Install-Package Our.Umbraco.DocTypeGridEditor
31+
32+
We also have a [MyGet package repository](https://www.myget.org/gallery/umbraco-packages) - for bleeding-edge / development releases.
2433

2534
#### Manual build
2635

@@ -78,7 +87,7 @@ Have a question?
7887

7988
### Special thanks
8089

81-
* Thanks to [Jeavon Leopold](https://github.com/Jeavon) for being a rockstar and adding AppVeyor support.
90+
* Thanks to [Jeavon Leopold](https://github.com/Jeavon) for being a rockstar and adding AppVeyor & NuGet support.
8291

8392

8493
## License

appveyor.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# version format
2-
version: 0.2.0.{build}
2+
version: 0.2.1.{build}
33

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

9+
cache:
10+
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
11+
912
build_script:
1013
- build-appveyor.cmd
1114

@@ -14,15 +17,15 @@ artifacts:
1417
- path: artifacts\*.zip
1518

1619
deploy:
17-
# # MyGet Deployment for builds & releases
18-
# - provider: NuGet
19-
# server: https://www.myget.org/F/name/
20-
# symbol_server: https://nuget.symbolsource.org/MyGet/name
21-
# api_key:
22-
# secure:
23-
# artifact: /.*\.nupkg/
24-
# on:
25-
# branch: develop
20+
# MyGet Deployment for builds & releases
21+
- provider: NuGet
22+
server: https://www.myget.org/F/umbraco-packages/
23+
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-packages
24+
api_key:
25+
secure: Q1/4K8VSwr7BjwmKDTef8y5lOc7S+jK9ELuWy67y6OVRpjxmnF9M3Gfs1kT+ir8x
26+
artifact: /.*\.nupkg/
27+
on:
28+
branch: develop
2629

2730
# GitHub Deployment for releases
2831
- provider: GitHub
@@ -35,12 +38,12 @@ deploy:
3538
branch: master
3639
appveyor_repo_tag: true # deploy on tag push only
3740

38-
# # NuGet Deployment for releases
39-
# - provider: NuGet
40-
# server:
41-
# api_key:
42-
# secure:
43-
# artifact: /.*\.nupkg/
44-
# on:
45-
# branch: master
46-
# appveyor_repo_tag: true
41+
# NuGet Deployment for releases
42+
- provider: NuGet
43+
server:
44+
api_key:
45+
secure: CGzDKxw4QI/z2VSe9ceiYlIabqGXHolgBgVNWWZjVAJ2V5WLF11IFdlp9r5Qp+Sw
46+
artifact: /.*\.nupkg/
47+
on:
48+
branch: master
49+
appveyor_repo_tag: true

build/install.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
param($installPath, $toolsPath, $package, $project)
2+
3+
$appPluginsFolder = $project.ProjectItems | Where-Object { $_.Name -eq "App_Plugins" }
4+
$docTypeGridEditorFolder = $appPluginsFolder.ProjectItems | Where-Object { $_.Name -eq "DocTypeGridEditor" }
5+
6+
if (!$docTypeGridEditorFolder)
7+
{
8+
$newPackageFiles = "$installPath\Content\App_Plugins\DocTypeGridEditor"
9+
10+
$projFile = Get-Item ($project.FullName)
11+
$projDirectory = $projFile.DirectoryName
12+
$projectPath = Join-Path $projDirectory -ChildPath "App_Plugins"
13+
$projectPathExists = Test-Path $projectPath
14+
15+
if ($projectPathExists) {
16+
Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project"
17+
Copy-Item $newPackageFiles $projectPath -Recurse -Force
18+
}
19+
}

build/package.proj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@
123123
<PluginFiles Include="$(CoreProjectDir)\Web\UI\**\*.*" />
124124
<PackageFile Include="$(MSBuildProjectDirectory)\package.xml" />
125125
<NuSpecFile Include="$(MSBuildProjectDirectory)\package.nuspec" />
126+
<NugetReadme Include="$(MSBuildProjectDirectory)\readme.txt" />
127+
<InstallPsFile Include="$(MSBuildProjectDirectory)\install.ps1" />
126128
</ItemGroup>
127129
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildUmbDir)\bin" />
128130
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(BuildUmbDir)" />
@@ -132,6 +134,8 @@
132134
<Copy SourceFiles="@(PluginFiles)" DestinationFiles="@(PluginFiles->'$(BuildNuGetDir)\Content\%(RecursiveDir)%(Filename)%(Extension)')" />
133135
<Copy SourceFiles="@(SrcFiles)" DestinationFiles="@(SrcFiles->'$(BuildNuGetDir)\src\%(RecursiveDir)%(Filename)%(Extension)')" />
134136
<Copy SourceFiles="@(NuSpecFile)" DestinationFolder="$(BuildNuGetDir)" />
137+
<Copy SourceFiles="@(NugetReadme)" DestinationFolder="$(BuildNuGetDir)" />
138+
<Copy SourceFiles="@(InstallPsFile)" DestinationFolder="$(BuildNuGetDir)\tools" />
135139
</Target>
136140

137141
<!-- MANIFEST UMBRACO -->
@@ -191,12 +195,12 @@
191195
OutputDirectory="$(ArtifactsDir)"
192196
Files="@(PackageFiles)" />
193197

194-
<!--<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\src\.nuget\NuGet.exe"
198+
<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\src\.nuget\NuGet.exe"
195199
ManifestFile="$(BuildNuGetDir)\package.nuspec"
196200
BasePath="$(BuildNuGetDir)"
197201
Version="$(ProductVersion)"
198202
OutputDirectory="$(ArtifactsDir)"
199-
Symbols="true" />-->
203+
Symbols="true" />
200204

201205
<RemoveDir Directories="$(BuildUmbDir)" Condition="Exists('$(BuildUmbDir)')" />
202206
<RemoveDir Directories="$(BuildNuGetDir)" Condition="Exists('$(BuildNuGetDir)')" />

build/readme.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
____ _____ ____ _ _ _____ _ _ _
2+
| _ \ ___ __|_ _| _ _ __ ___ / ___|_ __(_) __| | ____|__| (_) |_ ___ _ __
3+
| | | |/ _ \ / __|| || | | | '_ \ / _ \ | _| '__| |/ _` | _| / _` | | __/ _ \| '__|
4+
| |_| | (_) | (__ | || |_| | |_) | __/ |_| | | | | (_| | |__| (_| | | || (_) | |
5+
|____/ \___/ \___||_| \__, | .__/ \___|\____|_| |_|\__,_|_____\__,_|_|\__\___/|_|
6+
|___/|_|
7+
8+
--------------------------------------------------------------------------------------
9+
10+
To enable DocTypeGridEditor you must add the following JSON snippet to "grid.editors.config.js" found in the Config folder.
11+
12+
{
13+
"name": "Doc Type",
14+
"alias": "docType",
15+
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
16+
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
17+
"icon": "icon-item-arrangement",
18+
"config": {
19+
"allowedDocTypes": [],
20+
"nameTemplate": "",
21+
"enablePreview": true,
22+
"viewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/",
23+
"previewViewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/",
24+
"previewCssFilePath": "",
25+
"previewJsFilePath": ""
26+
}
27+
}

src/Our.Umbraco.DocTypeGridEditor.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CEE996
1414
EndProject
1515
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{D588B45D-9E67-4136-8271-2B8724C8165F}"
1616
ProjectSection(SolutionItems) = preProject
17+
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
18+
..\LICENSE.md = ..\LICENSE.md
1719
..\README.md = ..\README.md
1820
EndProjectSection
1921
EndProject
@@ -22,9 +24,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Pack
2224
..\appveyor.yml = ..\appveyor.yml
2325
..\build-appveyor.cmd = ..\build-appveyor.cmd
2426
..\build.cmd = ..\build.cmd
27+
..\build\install.ps1 = ..\build\install.ps1
2528
..\build\package.nuspec = ..\build\package.nuspec
2629
..\build\package.proj = ..\build\package.proj
2730
..\build\package.xml = ..\build\package.xml
31+
..\build\readme.txt = ..\build\readme.txt
2832
EndProjectSection
2933
EndProject
3034
Global

src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Our.Umbraco.DocTypeGridEditor.Extensions;
77
using Our.Umbraco.DocTypeGridEditor.Models;
88
using Umbraco.Core;
9+
using Umbraco.Core.Logging;
910
using Umbraco.Core.Models;
1011
using Umbraco.Core.Models.Editors;
1112
using Umbraco.Core.Models.PublishedContent;
@@ -78,10 +79,30 @@ private static IPublishedContent ConvertValue(string id, string contentTypeAlias
7879
* XML serialized state as expected by the published property by calling ConvertDbToString
7980
*/
8081
var propType2 = contentType.CompositionPropertyTypes.Single(x => x.Alias == propType.PropertyTypeAlias);
81-
var newValue2 = propEditor.ValueEditor.ConvertDbToString(new Property(propType2, newValue), propType2,
82-
ApplicationContext.Current.Services.DataTypeService);
8382

84-
properties.Add(new DetachedPublishedProperty(propType, newValue2));
83+
Property prop2 = null;
84+
try
85+
{
86+
/* HACK: [LK:2016-04-01] When using the "Umbraco.Tags" property-editor, the converted DB value does
87+
* not match the datatypes underlying db-column type. So it throws a "Type validation failed" exception.
88+
* We feel that the Umbraco core isn't handling the Tags value correctly, as it should be the responsiblity
89+
* of the "Umbraco.Tags" property-editor to handle the value conversion into the correct type.
90+
* See: http://issues.umbraco.org/issue/U4-8279
91+
*/
92+
prop2 = new Property(propType2, newValue);
93+
}
94+
catch(Exception ex)
95+
{
96+
LogHelper.Error<DocTypeGridEditorHelper>("Error creating Property object.", ex);
97+
}
98+
99+
if (prop2 != null)
100+
{
101+
var newValue2 = propEditor.ValueEditor.ConvertDbToString(prop2, propType2,
102+
ApplicationContext.Current.Services.DataTypeService);
103+
104+
properties.Add(new DetachedPublishedProperty(propType, newValue2));
105+
}
85106
}
86107
}
87108

src/Our.Umbraco.DocTypeGridEditor/Web/Extensions/HtmlHelperExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
1616
string editorAlias = "",
1717
string viewPath = "",
1818
string previewViewPath = "")
19-
{
20-
if (content == null)
19+
{
20+
if (content == null)
2121
return new HtmlString(string.Empty);
2222

23-
var controllerName = content.DocumentTypeAlias + "Surface";
23+
var controllerName = content.DocumentTypeAlias + "Surface";
2424

25-
if (!string.IsNullOrWhiteSpace(viewPath))
25+
if (!string.IsNullOrWhiteSpace(viewPath))
2626
viewPath = viewPath.TrimEnd('/') + "/";
2727

2828
if (!string.IsNullOrWhiteSpace(previewViewPath))
@@ -79,7 +79,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
7979
dtgePreviewViewPath = previewViewPath
8080
});
8181
}
82-
82+
8383
// Just go with a default action name
8484
return helper.Action("Index", defaultControllerName, new
8585
{
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"name": "Doc Type",
3-
"alias": "docType",
4-
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
5-
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
6-
"icon": "icon-item-arrangement",
7-
"config": {
8-
"allowedDocTypes": [],
2+
"name": "Doc Type",
3+
"alias": "docType",
4+
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
5+
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
6+
"icon": "icon-item-arrangement",
7+
"config": {
8+
"allowedDocTypes": [],
99
"nameTemplate": "",
1010
"enablePreview": true,
1111
"viewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/",
1212
"previewViewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/",
13-
"previewCssFilePath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/Css/dtge.css",
14-
"previewJsFilePath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/Js/dtge.js"
15-
}
13+
"previewCssFilePath": "",
14+
"previewJsFilePath": ""
15+
}
1616
}

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454

5555
$scope.setPreview = function (model) {
5656
if ("enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
57-
console.log(editorState.current);
5857
dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id,
5958
$scope.control.editor.alias, model.dtgeContentTypeAlias, model.value,
6059
$scope.control.editor.config.viewPath,
@@ -206,7 +205,6 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
206205
var tab = data.tabs[t];
207206
for (var p = 0; p < tab.properties.length; p++) {
208207
var prop = tab.properties[p];
209-
console.log(prop.alias);
210208
if ($scope.dialogData.value[prop.alias]) {
211209
prop.value = $scope.dialogData.value[prop.alias];
212210
}

0 commit comments

Comments
 (0)