Skip to content

Commit

Permalink
- Added Priority field on Category blade; (#191)
Browse files Browse the repository at this point in the history
- Removed unused code in CategoryConverter;
  • Loading branch information
yecli authored and tatarincev committed Dec 27, 2018
1 parent c022a9d commit c3c32f0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static webModel.Category ToWebModel(this moduleModel.Category category, I
retVal.CreatedDate = category.CreatedDate;
retVal.ModifiedBy = category.ModifiedBy;
retVal.ModifiedDate = category.ModifiedDate;
retVal.Priority = category.Priority;

retVal.SeoInfos = category.SeoInfos;
if (!category.Outlines.IsNullOrEmpty())
Expand All @@ -36,7 +37,6 @@ public static webModel.Category ToWebModel(this moduleModel.Category category, I
}

//Init outline and path
var parents = new List<moduleModel.Category>();
if (category.Parents != null)
{
retVal.Outline = string.Join("/", category.Parents.Select(x => x.Id));
Expand Down
9 changes: 7 additions & 2 deletions VirtoCommerce.CatalogModule.Web.Core/Model/Category.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using VirtoCommerce.Domain.Catalog.Model;
using VirtoCommerce.Domain.Commerce.Model;
Expand Down Expand Up @@ -71,13 +71,18 @@ public class Category : AuditableEntity, ISeoSupport, IHasOutlines
/// </summary>
public bool? IsActive { get; set; }

/// <summary>
/// Gets or sets category display order.
/// </summary>
public int Priority { get; set; }

/// <summary>
/// Gets or sets the properties.
/// </summary>
/// <value>
/// The properties.
/// </value>
public ICollection<Property> Properties { get; set; }
public ICollection<Property> Properties { get; set; }
/// <summary>
/// Gets or sets the links.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@
"is-active": "Is active",
"name": "Name",
"code": "Code",
"tax-type": "Tax type"
"tax-type": "Tax type",
"priority": "Priority"
},
"validations": {
"code": "Code can't contain $+;=%{}[]|/@ ~!^*&()?:'<>, characters"
},
"placeholders": {
"name": "Enter category name",
"code": "Enter category code",
"select": "Select..."
"select": "Select...",
"priority": "Enter number"
}
},
"categories-items-add": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
<div class="blade-content __medium-wide">
<div class="blade-content __medium-wide">
<div class="blade-inner">
<div class="inner-block">
<form name="detailForm" class="form">
<fieldset ng-init="setForm(detailForm);">
<va-metaform registered-inputs="blade.metaFields" blade="blade" column-count="2" ng-if="blade.currentEntity"></va-metaform>

<div class="form-group">
<label class="form-label">{{ 'catalog.blades.category-detail.labels.is-active' | translate }}</label>
<div class="form-input">
<label class="form-label __switch">
<input type="checkbox" ng-model="blade.currentEntity.isActive" />
<span class="switch"></span>
</label>
<div class="columns clearfix">
<div class="column">
<div class="form-group">
<label class="form-label">{{ 'catalog.blades.category-detail.labels.is-active' | translate }}</label>
<div class="form-input">
<label class="form-label __switch">
<input type="checkbox" ng-model="blade.currentEntity.isActive" />
<span class="switch"></span>
</label>
</div>
</div>
</div>
<div class="column">
<div class="form-group">
<label class="form-label">{{ 'catalog.blades.category-detail.labels.priority' | translate }}</label>
<div class="form-input __number">
<input smart-float num-type="integer" required ng-model="blade.currentEntity.priority" placeholder="{{ 'catalog.blades.category-detail.placeholders.priority' | translate }}" type="text" />
</div>
</div>
</div>
</div>
<div class="form-group">
Expand Down Expand Up @@ -53,4 +64,4 @@
<va-widget-container group="categoryDetail" blade="blade" data="blade.currentEntity" gridster-opts="{columns: 4}"></va-widget-container>
</div>
</div>
</div>
</div>

0 comments on commit c3c32f0

Please sign in to comment.