Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,15 @@
</BitLink>
</ItemTemplate>
<LoadingTemplate>
<BitStack Alignment="BitAlignment.Center">
<BitEllipsisLoading />
<BitStack>
<BitCard FullSize Class="product-item">
<BitStack Class="product-stack">
<ProductImage Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="2rem" Width="100%" />
</BitStack>
</BitCard>
</BitStack>
</LoadingTemplate>
</BitInfiniteScrolling>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ section {

.products-inf-scr {
gap: 1rem;
width: 100%;
display: flex;
flex-wrap: wrap;
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,32 @@

@if (isLoadingProduct)
{
<BitEllipsisLoading Size="BitSize.Large" />
<BitCard FullWidth Background="BitColorKind.Tertiary" Style="padding:3rem 1rem;">
<BitStack Horizontal HorizontalAlign="BitAlignment.Center" Gap="2rem">
<ProductImage Width="30%" />
<BitStack AutoHeight Grows>
<BitShimmer Height="6rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="3rem" Width="100%" />
</BitStack>
</BitStack>
</BitCard>

<br />

<BitText Typography="BitTypography.H4">@Localizer[nameof(AppStrings.AboutTitle)]</BitText>

<BitCard FullWidth>
<BitStack AutoHeight Grows>
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
<BitShimmer Height="1rem" Width="100%" />
</BitStack>
</BitCard>
}
else
{
Expand Down Expand Up @@ -69,12 +94,12 @@
making it a reliable and convenient mode of transportation for daily activities.
</BitText>
</BitCard>

<br />
<br />
}
}

<br />
<br />

@if (isLoadingSimilarProducts)
{
<BitText Typography="BitTypography.H4">@Localizer[nameof(AppStrings.SimilarProducts)]</BitText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ await cookie.Set(new()
{
Name = ".AspNetCore.Culture",
Value = Uri.EscapeDataString($"c={cultureName}|uic={cultureName}"),
MaxAge = 30 * 24 * 3600,
MaxAge = 3600 * 24 * 30,
Path = "/",
SameSite = SameSite.Strict,
Secure = AppEnvironment.IsDev() is false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task<ProductDto> Update(ProductDto dto, CancellationToken cancellat

await DbContext.SaveChangesAsync(cancellationToken);

await responseCacheService.PurgeCache("/", $"product/{dto.Id}", $"api/ProductView/{dto.Id}" /*You can also use Url.Action to build urls.*/);
await responseCacheService.PurgeCache("/", $"product/{dto.Id}", $"api/ProductView/Get/{dto.Id}" /*You can also use Url.Action to build urls.*/);

//#if (signalR == true)
await PublishDashboardDataChanged(cancellationToken);
Expand All @@ -94,7 +94,7 @@ public async Task Delete(Guid id, string concurrencyStamp, CancellationToken can

await DbContext.SaveChangesAsync(cancellationToken);

await responseCacheService.PurgeCache("/", $"product/{id}", $"api/ProductView/{id}" /*You can also use Url.Action to build urls.*/);
await responseCacheService.PurgeCache("/", $"product/{id}", $"api/ProductView/Get/{id}" /*You can also use Url.Action to build urls.*/);

//#if (signalR == true)
await PublishDashboardDataChanged(cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Boilerplate.Server.Api.Controllers.Products;
[AllowAnonymous]
public partial class ProductViewController : AppControllerBase, IProductViewController
{
[HttpGet, EnableQuery]
[HttpGet, EnableQuery, AppResponseCache(MaxAge = 60 * 5, SharedMaxAge = 0, UserAgnostic = true)]
public IQueryable<ProductDto> Get()
{
return DbContext.Products.OrderByDescending(p => p.Name).Project();
}

[HttpGet]
[HttpGet, AppResponseCache(MaxAge = 60 * 5, SharedMaxAge = 0, UserAgnostic = true)]
public async Task<List<ProductDto>> GetHomeCarouselProducts(CancellationToken cancellationToken)
{
return await Get().Take(10).ToListAsync(cancellationToken);
Expand Down
Loading