Skip to content

Commit fe7560d

Browse files
committed
* (Perf) drastically reduced amount of routes, accompanied by reorganizing them (removed ~80 routes, now we have ~50 routes in SmartStore.Web)
* (Perf/Dev) Heavily reorganized CatalogController by moving product detail specific actions to the new ProductController, alongside with moving the corresponding views
1 parent 2a48507 commit fe7560d

117 files changed

Lines changed: 3948 additions & 4146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Libraries/SmartStore.Core/Async/AsyncExtensions.cs

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/Libraries/SmartStore.Core/Async/AsyncRunner.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ namespace SmartStore.Core.Async
1010

1111
public static class AsyncRunner
1212
{
13+
private static readonly TaskFactory _myTaskFactory;
14+
15+
static AsyncRunner()
16+
{
17+
_myTaskFactory = new TaskFactory(CancellationToken.None, TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.Default);
18+
}
19+
20+
public static void RunSync(Func<Task> func)
21+
{
22+
_myTaskFactory.StartNew<Task>(func).Unwrap().GetAwaiter().GetResult();
23+
}
24+
25+
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
26+
{
27+
return _myTaskFactory.StartNew<Task<TResult>>(func).Unwrap<TResult>().GetAwaiter().GetResult();
28+
}
1329

1430
public static Task Run(Action<ILifetimeScope> action)
1531
{

src/Libraries/SmartStore.Core/SmartStore.Core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
<Compile Include="..\..\AssemblyVersionInfo.cs">
145145
<Link>Properties\AssemblyVersionInfo.cs</Link>
146146
</Compile>
147-
<Compile Include="Async\AsyncExtensions.cs" />
148147
<Compile Include="Async\AsyncState.cs" />
149148
<Compile Include="Caching\DefaultCacheManager.cs" />
150149
<Compile Include="Caching\AspNetCache.cs" />

src/Libraries/SmartStore.Services/ExportImport/IImportManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public static Task<ImportResult> ImportProductsFromExcelAsync(
3737

3838
public static ImportResult ImportProductsFromExcel(this IImportManager importManager, Stream stream)
3939
{
40-
Func<Task<ImportResult>> fn = () => importManager.ImportProductsFromExcelAsync(stream);
41-
return fn.RunSync();
40+
//Func<Task<ImportResult>> fn = () => importManager.ImportProductsFromExcelAsync(stream);
41+
//return fn.RunSync();
42+
return AsyncRunner.RunSync(() => importManager.ImportProductsFromExcelAsync(stream));
4243
}
4344
}
4445
}

src/Libraries/SmartStore.Services/ExportImport/ImportManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ public virtual async Task<ImportResult> ImportProductsFromExcelAsync(
132132

133133
var result = new ImportResult();
134134
int saved = 0;
135-
136-
progress.Report(new ImportProgressInfo { ElapsedTime = TimeSpan.Zero });
135+
136+
if (progress != null)
137+
progress.Report(new ImportProgressInfo { ElapsedTime = TimeSpan.Zero });
137138

138139
using (var scope = new DbContextScope(ctx: _rsProduct.Context, autoDetectChanges: false, proxyCreation: false, validateOnSave: false))
139140
{

src/Presentation/SmartStore.Web.Framework/Seo/GenericPathRoute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ public override RouteData GetRouteData(HttpContextBase httpContext)
117117
{
118118
case "product":
119119
{
120-
data.Values["controller"] = "Catalog";
121-
data.Values["action"] = "Product";
120+
data.Values["controller"] = "Product";
121+
data.Values["action"] = "ProductDetails";
122122
data.Values["productid"] = urlRecord.EntityId;
123123
}
124124
break;

src/Presentation/SmartStore.Web/Content/theme.common.less

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -884,69 +884,74 @@ fieldset > legend {
884884
font-size: .85em;
885885
}
886886

887+
.glimpse-nowrap {
888+
z-index: 100;
889+
}
890+
887891

892+
/* Product Bundle Items
893+
================================================ */
888894

889-
/* PRODUCT BUNDLE ITEMS */
890895
.product-bundle {
891896
.bundle-item-border {
892897
border-top: 1px solid #ddd;
893898
}
894899
}
895900

896-
.product-bundle .bundle-item {
897-
margin-top: 10px;
898-
padding-top: 10px;
899-
900-
.bundle-item-attributes {
901-
margin-top: 3px;
902-
}
903-
904-
.bundle-item-image {
905-
float: left;
906-
margin-right: 16px;
907-
}
901+
.product-bundle .bundle-item {
902+
margin-top: 10px;
903+
padding-top: 10px;
908904

909-
.bundle-item-body {
910-
display: table-cell;
911-
}
905+
.bundle-item-attributes {
906+
margin-top: 3px;
907+
}
912908

913-
.bundle-item-name {
914-
font-weight: bold;
915-
}
909+
.bundle-item-image {
910+
float: left;
911+
margin-right: 16px;
912+
}
916913

917-
.bundle-item-price {
918-
padding: 5px 0 5px 0;
914+
.bundle-item-body {
915+
display: table-cell;
916+
}
919917

920-
.product-price-without-discount,
921-
.product-price-with-discount {
922-
font-size: 1.1em;
923-
}
918+
.bundle-item-name {
919+
font-weight: bold;
920+
}
924921

925-
.older-price {
926-
text-decoration: line-through;
927-
color: #aaa;
928-
}
922+
.bundle-item-price {
923+
padding: 5px 0 5px 0;
929924

930-
.base-price {
931-
font-size: 0.85em;
932-
}
925+
.product-price-without-discount,
926+
.product-price-with-discount {
927+
font-size: 1.1em;
933928
}
934929

935-
.bundle-item-description {
936-
font-size: 12px;
937-
line-height: 18px;
930+
.older-price {
931+
text-decoration: line-through;
932+
color: #aaa;
938933
}
939934

940-
.bundle-item-attribute-info {
935+
.base-price {
941936
font-size: 0.85em;
942-
line-height: 1.45em;
943937
}
938+
}
944939

945-
.bundle-item-footer {
946-
clear: both;
947-
padding-top: 13px;
948-
}
940+
.bundle-item-description {
941+
font-size: 12px;
942+
line-height: 18px;
943+
}
944+
945+
.bundle-item-attribute-info {
946+
font-size: 0.85em;
947+
line-height: 1.45em;
948+
}
949+
950+
.bundle-item-footer {
951+
clear: both;
952+
padding-top: 13px;
949953
}
954+
}
950955

951956
#AddToCart.bundled-product {
952957
border-top: none !important;
@@ -956,9 +961,11 @@ fieldset > legend {
956961
margin-right: 5px;
957962
vertical-align: middle;
958963
}
964+
959965
.attributes .attribute-value-image-checkbox {
960966
float: left;
961967
}
968+
962969
.attributes .image-has-value {
963970
margin-left: 28px;
964971
}
@@ -971,10 +978,12 @@ fieldset > legend {
971978
.mb-bundle-pictures i {
972979
float: left;
973980
}
981+
974982
.mb-bundle-pictures img {
975983
max-width: 24px;
976984
max-height: 24px;
977985
}
986+
978987
.bundle-item-overview-headline {
979988
margin-bottom: 14px;
980989

@@ -1006,9 +1015,11 @@ fieldset > legend {
10061015
float: right;
10071016
}
10081017
}
1018+
10091019
.bundle-item-overview-headline .form-inline {
10101020
text-align:right;
10111021
}
1022+
10121023
.bundle-item-overview .icon-plus {
10131024
padding: 0 5px;
10141025
}

0 commit comments

Comments
 (0)