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

Release 0.2.1 #46

Merged
merged 7 commits into from
Apr 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ _ReSharper.*
Thumbs.db
.DS_Store
*.log
.vs

artifacts/
src/packages/*/**
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Guidelines for bug reports:
2. **Check if the issue has been fixed** — try to reproduce it using the
latest `master` or development branch in the repository.

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

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Doc Type Grid Editor

[![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)
[![NuGet release](https://img.shields.io/nuget/v/Our.Umbraco.DocTypeGridEditor.svg)](https://www.nuget.org/packages/Our.Umbraco.DocTypeGridEditor)
[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)
[![Chat on Gitter](https://img.shields.io/badge/gitter-join_chat-green.svg)](https://gitter.im/leekelleher/umbraco-doc-type-grid-editor)

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

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

> [https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)
> [https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor](https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor)

#### NuGet package repository

To [install from NuGet](https://www.nuget.org/packages/Our.Umbraco.DocTypeGridEditor), you can run the following command from within Visual Studio:

PM> Install-Package Our.Umbraco.DocTypeGridEditor

We also have a [MyGet package repository](https://www.myget.org/gallery/umbraco-packages) - for bleeding-edge / development releases.

#### Manual build

Expand Down Expand Up @@ -78,7 +87,7 @@ Have a question?

### Special thanks

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


## License
Expand Down
41 changes: 22 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# version format
version: 0.2.0.{build}
version: 0.2.1.{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=

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

build_script:
- build-appveyor.cmd

Expand All @@ -14,15 +17,15 @@ artifacts:
- path: artifacts\*.zip

deploy:
# # MyGet Deployment for builds & releases
# - provider: NuGet
# server: https://www.myget.org/F/name/
# symbol_server: https://nuget.symbolsource.org/MyGet/name
# api_key:
# secure:
# artifact: /.*\.nupkg/
# on:
# branch: develop
# MyGet Deployment for builds & releases
- provider: NuGet
server: https://www.myget.org/F/umbraco-packages/
symbol_server: https://nuget.symbolsource.org/MyGet/umbraco-packages
api_key:
secure: Q1/4K8VSwr7BjwmKDTef8y5lOc7S+jK9ELuWy67y6OVRpjxmnF9M3Gfs1kT+ir8x
artifact: /.*\.nupkg/
on:
branch: develop

# GitHub Deployment for releases
- provider: GitHub
Expand All @@ -35,12 +38,12 @@ deploy:
branch: master
appveyor_repo_tag: true # deploy on tag push only

# # NuGet Deployment for releases
# - provider: NuGet
# server:
# api_key:
# secure:
# artifact: /.*\.nupkg/
# on:
# branch: master
# appveyor_repo_tag: true
# NuGet Deployment for releases
- provider: NuGet
server:
api_key:
secure: CGzDKxw4QI/z2VSe9ceiYlIabqGXHolgBgVNWWZjVAJ2V5WLF11IFdlp9r5Qp+Sw
artifact: /.*\.nupkg/
on:
branch: master
appveyor_repo_tag: true
19 changes: 19 additions & 0 deletions build/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
param($installPath, $toolsPath, $package, $project)

$appPluginsFolder = $project.ProjectItems | Where-Object { $_.Name -eq "App_Plugins" }
$docTypeGridEditorFolder = $appPluginsFolder.ProjectItems | Where-Object { $_.Name -eq "DocTypeGridEditor" }

if (!$docTypeGridEditorFolder)
{
$newPackageFiles = "$installPath\Content\App_Plugins\DocTypeGridEditor"

$projFile = Get-Item ($project.FullName)
$projDirectory = $projFile.DirectoryName
$projectPath = Join-Path $projDirectory -ChildPath "App_Plugins"
$projectPathExists = Test-Path $projectPath

if ($projectPathExists) {
Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project"
Copy-Item $newPackageFiles $projectPath -Recurse -Force
}
}
8 changes: 6 additions & 2 deletions build/package.proj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
<PluginFiles Include="$(CoreProjectDir)\Web\UI\**\*.*" />
<PackageFile Include="$(MSBuildProjectDirectory)\package.xml" />
<NuSpecFile Include="$(MSBuildProjectDirectory)\package.nuspec" />
<NugetReadme Include="$(MSBuildProjectDirectory)\readme.txt" />
<InstallPsFile Include="$(MSBuildProjectDirectory)\install.ps1" />
</ItemGroup>
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildUmbDir)\bin" />
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(BuildUmbDir)" />
Expand All @@ -132,6 +134,8 @@
<Copy SourceFiles="@(PluginFiles)" DestinationFiles="@(PluginFiles->'$(BuildNuGetDir)\Content\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(SrcFiles)" DestinationFiles="@(SrcFiles->'$(BuildNuGetDir)\src\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(NuSpecFile)" DestinationFolder="$(BuildNuGetDir)" />
<Copy SourceFiles="@(NugetReadme)" DestinationFolder="$(BuildNuGetDir)" />
<Copy SourceFiles="@(InstallPsFile)" DestinationFolder="$(BuildNuGetDir)\tools" />
</Target>

<!-- MANIFEST UMBRACO -->
Expand Down Expand Up @@ -191,12 +195,12 @@
OutputDirectory="$(ArtifactsDir)"
Files="@(PackageFiles)" />

<!--<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\src\.nuget\NuGet.exe"
<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\src\.nuget\NuGet.exe"
ManifestFile="$(BuildNuGetDir)\package.nuspec"
BasePath="$(BuildNuGetDir)"
Version="$(ProductVersion)"
OutputDirectory="$(ArtifactsDir)"
Symbols="true" />-->
Symbols="true" />

<RemoveDir Directories="$(BuildUmbDir)" Condition="Exists('$(BuildUmbDir)')" />
<RemoveDir Directories="$(BuildNuGetDir)" Condition="Exists('$(BuildNuGetDir)')" />
Expand Down
27 changes: 27 additions & 0 deletions build/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
____ _____ ____ _ _ _____ _ _ _
| _ \ ___ __|_ _| _ _ __ ___ / ___|_ __(_) __| | ____|__| (_) |_ ___ _ __
| | | |/ _ \ / __|| || | | | '_ \ / _ \ | _| '__| |/ _` | _| / _` | | __/ _ \| '__|
| |_| | (_) | (__ | || |_| | |_) | __/ |_| | | | | (_| | |__| (_| | | || (_) | |
|____/ \___/ \___||_| \__, | .__/ \___|\____|_| |_|\__,_|_____\__,_|_|\__\___/|_|
|___/|_|

--------------------------------------------------------------------------------------

To enable DocTypeGridEditor you must add the following JSON snippet to "grid.editors.config.js" found in the Config folder.

{
"name": "Doc Type",
"alias": "docType",
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
"icon": "icon-item-arrangement",
"config": {
"allowedDocTypes": [],
"nameTemplate": "",
"enablePreview": true,
"viewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/",
"previewViewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/",
"previewCssFilePath": "",
"previewJsFilePath": ""
}
}
4 changes: 4 additions & 0 deletions src/Our.Umbraco.DocTypeGridEditor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CEE996
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{D588B45D-9E67-4136-8271-2B8724C8165F}"
ProjectSection(SolutionItems) = preProject
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
..\LICENSE.md = ..\LICENSE.md
..\README.md = ..\README.md
EndProjectSection
EndProject
Expand All @@ -22,9 +24,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Pack
..\appveyor.yml = ..\appveyor.yml
..\build-appveyor.cmd = ..\build-appveyor.cmd
..\build.cmd = ..\build.cmd
..\build\install.ps1 = ..\build\install.ps1
..\build\package.nuspec = ..\build\package.nuspec
..\build\package.proj = ..\build\package.proj
..\build\package.xml = ..\build\package.xml
..\build\readme.txt = ..\build\readme.txt
EndProjectSection
EndProject
Global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Our.Umbraco.DocTypeGridEditor.Extensions;
using Our.Umbraco.DocTypeGridEditor.Models;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.Models.PublishedContent;
Expand Down Expand Up @@ -78,10 +79,30 @@ private static IPublishedContent ConvertValue(string id, string contentTypeAlias
* XML serialized state as expected by the published property by calling ConvertDbToString
*/
var propType2 = contentType.CompositionPropertyTypes.Single(x => x.Alias == propType.PropertyTypeAlias);
var newValue2 = propEditor.ValueEditor.ConvertDbToString(new Property(propType2, newValue), propType2,
ApplicationContext.Current.Services.DataTypeService);

properties.Add(new DetachedPublishedProperty(propType, newValue2));
Property prop2 = null;
try
{
/* HACK: [LK:2016-04-01] When using the "Umbraco.Tags" property-editor, the converted DB value does
* not match the datatypes underlying db-column type. So it throws a "Type validation failed" exception.
* We feel that the Umbraco core isn't handling the Tags value correctly, as it should be the responsiblity
* of the "Umbraco.Tags" property-editor to handle the value conversion into the correct type.
* See: http://issues.umbraco.org/issue/U4-8279
*/
prop2 = new Property(propType2, newValue);
}
catch(Exception ex)
{
LogHelper.Error<DocTypeGridEditorHelper>("Error creating Property object.", ex);
}

if (prop2 != null)
{
var newValue2 = propEditor.ValueEditor.ConvertDbToString(prop2, propType2,
ApplicationContext.Current.Services.DataTypeService);

properties.Add(new DetachedPublishedProperty(propType, newValue2));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
string editorAlias = "",
string viewPath = "",
string previewViewPath = "")
{
if (content == null)
{
if (content == null)
return new HtmlString(string.Empty);

var controllerName = content.DocumentTypeAlias + "Surface";
var controllerName = content.DocumentTypeAlias + "Surface";

if (!string.IsNullOrWhiteSpace(viewPath))
if (!string.IsNullOrWhiteSpace(viewPath))
viewPath = viewPath.TrimEnd('/') + "/";

if (!string.IsNullOrWhiteSpace(previewViewPath))
Expand Down Expand Up @@ -79,7 +79,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
dtgePreviewViewPath = previewViewPath
});
}

// Just go with a default action name
return helper.Action("Index", defaultControllerName, new
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "Doc Type",
"alias": "docType",
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
"icon": "icon-item-arrangement",
"config": {
"allowedDocTypes": [],
"name": "Doc Type",
"alias": "docType",
"view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html",
"render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml",
"icon": "icon-item-arrangement",
"config": {
"allowedDocTypes": [],
"nameTemplate": "",
"enablePreview": true,
"viewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/",
"previewViewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/",
"previewCssFilePath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/Css/dtge.css",
"previewJsFilePath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/Js/dtge.js"
}
"previewCssFilePath": "",
"previewJsFilePath": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

$scope.setPreview = function (model) {
if ("enablePreview" in $scope.control.editor.config && $scope.control.editor.config.enablePreview) {
console.log(editorState.current);
dtgeResources.getEditorMarkupForDocTypePartial(editorState.current.id, model.id,
$scope.control.editor.alias, model.dtgeContentTypeAlias, model.value,
$scope.control.editor.config.viewPath,
Expand Down Expand Up @@ -206,7 +205,6 @@ angular.module("umbraco").controller("Our.Umbraco.DocTypeGridEditor.Dialogs.DocT
var tab = data.tabs[t];
for (var p = 0; p < tab.properties.length; p++) {
var prop = tab.properties[p];
console.log(prop.alias);
if ($scope.dialogData.value[prop.alias]) {
prop.value = $scope.dialogData.value[prop.alias];
}
Expand Down