Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#92 changed variant editor to use new package.manifest format, #91 added null check on attribute group #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,16 @@
if ($scope.variantGroups) {
for (var i = 0; i < $scope.variantGroups.length; i++) {
var variantGroup = $scope.variantGroups[i];
for (var y = 0; y < variantGroup.items.length; y++) {
var item = variantGroup.items[y];
if (item.checked) {
if (!checkedGroups[variantGroup.id]) {
checkedGroups[variantGroup.id] = [];
// BH: avoid empty attribute groups, issue #91
if (variantGroup.items !== null && variantGroups.items.length > 0) {
for (var y = 0; y < variantGroup.items.length; y++) {
var item = variantGroup.items[y];
if (item.checked) {
if (!checkedGroups[variantGroup.id]) {
checkedGroups[variantGroup.id] = [];
}
checkedGroups[variantGroup.id].push({ name: item.name, id: item.id, groupName: variantGroup.name, groupId: variantGroup.id });
}
checkedGroups[variantGroup.id].push({ name: item.name, id: item.id, groupName: variantGroup.name, groupId: variantGroup.id });
}
}
}
Expand Down
62 changes: 61 additions & 1 deletion Source/TeaCommerce.Umbraco.Application/package.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,70 @@
hideLabel: false,
valueType: 'STRING'
}
},{
alias: 'TeaCommerce.VariantEditor',
name: 'Tea Commerce: Variant editor',
editor: {
view: '~/App_Plugins/TeaCommerce/PropertyEditors/variant-editor.html',
hideLabel: false,
valueType: 'JSON'
},
prevalues: {
fields: [
{
label: 'Variant Attribute Groups XPath Or Node',
description: 'Enter an XPath statement to locate node containing all attribute groups or select the node.',
key: 'xpathOrNode',
view: '~/App_Plugins/TeaCommerce/PropertyEditors/variant-editor-node-type.html'
},
{
label: 'Variant document type',
description: '[Optional] A document type that makes it possible to enrich each variant combination with extra information.',
key: 'variantDocumentType',
view: 'textstring'
},
{
label: 'Extra list information',
description: '[Optional] Comma-separated list of property aliases from the ',
key: 'extraListInformation',
view: 'textstring'
},
{
label: 'Variant group document types',
description: '[Optional] Comma-separated list of the variant group document types that can be chosen from. e.g. "Color,Size".',
key: 'variantGroupDocumentTypes',
view: 'textstring'
},
{
label: 'Variant group name',
description: '[Optional] Comma-separated list of the variant group node names that can be chosen from. e.g. "Color,Size".',
key: 'variantGroupNodeName',
view: 'textstring'
},
{
label: 'Force editor to choose all variant groups',
description: 'Editor will be forced to choose at least one variant type from each variant group when creating variants.',
key: 'forceEditorToChooseAllVariantGroups',
view: 'boolean'
},
{
label: 'Hide Label',
description: 'Hide the Umbraco property title and description, making the Variant Editor span the entire page width',
key: 'hideLabel',
view: 'boolean'
}
]
}
}],
javascript: [
'~/App_Plugins/TeaCommerce/PropertyEditors/store-picker.controller.js',
'~/App_Plugins/TeaCommerce/PropertyEditors/vat-group-picker.controller.js',
'~/App_Plugins/TeaCommerce/PropertyEditors/stock-management.controller.js'
'~/App_Plugins/TeaCommerce/PropertyEditors/stock-management.controller.js',
'~/App_Plugins/TeaCommerce/PropertyEditors/js.cookie.js',
'~/App_Plugins/TeaCommerce/PropertyEditors/variant-editor-node-type.js',
'~/App_Plugins/TeaCommerce/PropertyEditors/variant-editor.controller.js'
],
css: [
'~/App_Plugins/TeaCommerce/PropertyEditors/variant-editor.css'
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
<Compile Include="Persistence\DatabaseFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\VersionInfo.cs" />
<Compile Include="PropertyEditors\VariantEditorPropertyEditor.cs" />
<Compile Include="Variants\Services\AVariantService.cs" />
<Compile Include="Variants\Services\IVariantService.cs" />
<Compile Include="Services\ILanguageService.cs" />
Expand All @@ -148,7 +147,9 @@
<Compile Include="Variants\Models\VariantPublishedContent.cs" />
<Compile Include="Variants\Models\VariantPublishedProperty.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="PropertyEditors\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down