diff --git a/Netina.AdminPanel.PWA/App.razor b/Netina.AdminPanel.PWA/App.razor index 4a275f8..a804f5a 100644 --- a/Netina.AdminPanel.PWA/App.razor +++ b/Netina.AdminPanel.PWA/App.razor @@ -1,5 +1,4 @@ -@using Netina.AdminPanel.PWA.Models -@using Netina.AdminPanel.PWA.Layout +@using Netina.AdminPanel.PWA.Layout @using Netina.AdminPanel.PWA.Pages diff --git a/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor b/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor index 69a6e80..f5dbffb 100644 --- a/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor +++ b/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor @@ -85,6 +85,60 @@ + + اطلاعات متا تگ + می توانید متا تگ های سئو برای صفحه مورد نظر را وارد کنید + + + + + + + + + + + + افزودن + + + + + + + + + + + + حذف + + + + + + + + + سوالات متداول @@ -120,7 +174,7 @@ Size="@Size.Small" Variant="@Variant.Outlined" Color="@Color.Error" - OnClick="() => ViewModel.Faqs.Remove(item.Key)" /> + OnClick="() => ViewModel.Faqs.Remove(item.Key)"/> @item.Key diff --git a/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor.cs b/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor.cs index 2534e84..b2cbc5e 100644 --- a/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor.cs +++ b/Netina.AdminPanel.PWA/Dialogs/BrandActionDialogBox.razor.cs @@ -1,4 +1,5 @@ -using Netina.Domain.Entities.Brands; +using Netina.Domain.Dtos.LargDtos; +using Netina.Domain.Entities.Brands; namespace Netina.AdminPanel.PWA.Dialogs; @@ -65,6 +66,7 @@ public class BrandActionDialogBoxViewModel : BaseViewModel IsProcessing = true; var response = await _restWrapper.CrudDtoApiRest(Address.BrandController).ReadOne(Brand.Id); var brandLDto = response; + brandLDto.MetaTags.ForEach(m => MetaTags.Add(m)); PageDto = brandLDto; } catch (ApiException ex) @@ -106,7 +108,7 @@ public class BrandActionDialogBoxViewModel : BaseViewModel PageDto.PageUrl, PageDto.Files, Faqs, - new Dictionary()); + MetaTags.ToDictionary(x => x.Type, x => x.Value)); await _restWrapper.CrudApiRest(Address.BrandController).Create(request, token); _mudDialog.Close(DialogResult.Ok(true)); } @@ -147,7 +149,7 @@ public class BrandActionDialogBoxViewModel : BaseViewModel PageDto.PageUrl, PageDto.Files, Faqs, - new Dictionary()); + MetaTags.ToDictionary(x => x.Type, x => x.Value)); await _restWrapper.CrudApiRest(Address.BrandController).Update(request, token); _mudDialog.Close(); @@ -191,6 +193,26 @@ public class BrandActionDialogBoxViewModel : BaseViewModel } } + public readonly ObservableCollection MetaTags = new(); + public string MetaTagType { get; set; } = string.Empty; + public string MetaTagValue { get; set; } = string.Empty; + public void AddMetaTag() + { + try + { + if (MetaTagType.IsNullOrEmpty()) + throw new Exception("لطفا نوع متا مورد نظر را وارد کنید"); + if (MetaTagValue.IsNullOrEmpty()) + throw new Exception("لطفا مقدار متا مورد نظر را وارد کنید"); + + MetaTags.Add(new MetaTagSDto() { Type = MetaTagType, Value = MetaTagValue }); + } + catch (Exception e) + { + _snackbar.Add(e.Message, Severity.Error); + } + } + public async Task SelectFileAsync() { diff --git a/Netina.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor b/Netina.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor index c03cd54..ebd57cb 100644 --- a/Netina.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor +++ b/Netina.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor @@ -133,7 +133,7 @@ - + diff --git a/Netina.AdminPanel.PWA/Netina.AdminPanel.PWA.csproj b/Netina.AdminPanel.PWA/Netina.AdminPanel.PWA.csproj index c3fc990..15aaf51 100644 --- a/Netina.AdminPanel.PWA/Netina.AdminPanel.PWA.csproj +++ b/Netina.AdminPanel.PWA/Netina.AdminPanel.PWA.csproj @@ -5,8 +5,8 @@ enable enable service-worker-assets.js - 1.7.20.34 - 1.7.20.34 + 1.10.21.36 + 1.10.21.36 $(MSBuildProjectName) diff --git a/Netina.AdminPanel.PWA/Pages/BrandsPage.razor b/Netina.AdminPanel.PWA/Pages/BrandsPage.razor index 333d4a7..666306c 100644 --- a/Netina.AdminPanel.PWA/Pages/BrandsPage.razor +++ b/Netina.AdminPanel.PWA/Pages/BrandsPage.razor @@ -1,5 +1,4 @@ @page "/product/brands" -@using StringExtensions = Netina.Common.Extensions.StringExtensions @inject IDialogService DialogService @inject NavigationManager NavigationManager