history fix
This commit is contained in:
parent
e0163353ef
commit
a7e8831ff9
|
|
@ -14,23 +14,20 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||||
@using TIAMWebApp.Shared.Application.Services
|
@using TIAMWebApp.Shared.Application.Services
|
||||||
@inject IServiceProviderDataService ServiceProviderDataService
|
@inject IServiceProviderDataService ServiceProviderDataService
|
||||||
@inject IUserDataService UserDataService;
|
@inject IUserDataService UserDataService
|
||||||
@inject AdminSignalRClient AdminSignalRClient;
|
@inject AdminSignalRClient AdminSignalRClient
|
||||||
@inject IJSRuntime JsRuntime;
|
@inject IJSRuntime JsRuntime
|
||||||
@inject NavigationManager NavManager;
|
@inject NavigationManager NavManager
|
||||||
|
|
||||||
<div class="e-card cw-480">
|
<div class="e-card cw-480">
|
||||||
<div class="e-main d-flex align-items-center">
|
<div class="e-main d-flex align-items-center">
|
||||||
@* <div class="flex-shrink-0">
|
|
||||||
<img class="e-photo" src="_content/TIAMSharedUI/images/defaultavatar_60.png" alt="" />
|
|
||||||
</div> *@
|
|
||||||
|
|
||||||
<div class="flex-shrink-0">
|
<div class="flex-shrink-0">
|
||||||
<a href="api/pictures/1" download="data:image/png;base64,@ImageSource" target="_top">
|
<a href="api/pictures/1" download="data:image/png;base64,@ImageSource" target="_top">
|
||||||
|
<img class="align-self-center img-fluid" src="data:image/png;base64,@ImageSource" width="128" />
|
||||||
<img class="align-self-center img-fluid"
|
|
||||||
src="data:image/png;base64,@ImageSource" width="128" />
|
|
||||||
</a>
|
</a>
|
||||||
|
<br />
|
||||||
|
<DxButton Context="ButtonContext" CssClass="btn-primary" Click="DownloadImage"><i class="fa-solid fa-download"></i> Download QR</DxButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="e-info flex-grow-1 ms-3">
|
<div class="e-info flex-grow-1 ms-3">
|
||||||
|
|
@ -45,7 +42,6 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-3">
|
<div class="col-12 col-md-3">
|
||||||
<h4>Information</h4>
|
<h4>Information</h4>
|
||||||
|
|
||||||
@RenderDetailsItem("fa-solid fa-user", "Contact Name", productProfile.FullName)
|
@RenderDetailsItem("fa-solid fa-user", "Contact Name", productProfile.FullName)
|
||||||
@RenderDetailsItem("fa-solid fa-circle-info", "Description", Context.Description)
|
@RenderDetailsItem("fa-solid fa-circle-info", "Description", Context.Description)
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -59,17 +55,11 @@
|
||||||
<p>Use this link to send it in an email to the client</p>
|
<p>Use this link to send it in an email to the client</p>
|
||||||
<a href="@_url" target="_blank">@_url</a>
|
<a href="@_url" target="_blank">@_url</a>
|
||||||
<DxButton Context="ButtonContext" CssClass="btn-primary" Click="() => CopyUrl(_url)"><i class="fa-solid fa-copy"></i></DxButton>
|
<DxButton Context="ButtonContext" CssClass="btn-primary" Click="() => CopyUrl(_url)"><i class="fa-solid fa-copy"></i></DxButton>
|
||||||
// <DxButton CssClass="btn btn-primary" Click="() => CopyUrl(_url)">Copy referral url</DxButton>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-md-6">
|
<div class="col-12 col-md-6"></div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="row py-3">
|
<div class="row py-3">
|
||||||
|
|
@ -89,15 +79,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
@{
|
@{
|
||||||
|
|
||||||
if (!isAddressTransferDestination)
|
if (!isAddressTransferDestination)
|
||||||
{
|
{
|
||||||
// <p>Address:</p>
|
|
||||||
// <p>@(((Product)context.DataItem).Profile.Address.AddressText)</p>
|
|
||||||
<DxButton Click="() => SaveAsDestination(productProfile.Address, Context)" Text="Save as destination" RenderStyle="ButtonRenderStyle.Primary" />
|
<DxButton Click="() => SaveAsDestination(productProfile.Address, Context)" Text="Save as destination" RenderStyle="ButtonRenderStyle.Primary" />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4"></div>
|
<div class="col-4"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -114,6 +100,15 @@
|
||||||
alert('Could not copy text: ' + err);
|
alert('Could not copy text: ' + err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function downloadImage(base64String, filename) {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = base64String;
|
||||||
|
link.download = filename;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
@ -126,17 +121,21 @@
|
||||||
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
AccordionExpandCollapseAction ExpandCollapseAction { get; set; } = AccordionExpandCollapseAction.HeaderClick;
|
||||||
|
|
||||||
private Profile productProfile = new Profile();
|
private Profile productProfile = new Profile();
|
||||||
private List<TransferDestination> destinations = [];
|
private List<TransferDestination> destinations = new List<TransferDestination>();
|
||||||
string msg;
|
string msg;
|
||||||
private bool isSaveActive = false;
|
private bool isSaveActive = false;
|
||||||
private bool isAddressTransferDestination = false;
|
private bool isAddressTransferDestination = false;
|
||||||
|
|
||||||
private async Task CopyUrl(string url)
|
private async Task CopyUrl(string url)
|
||||||
{
|
{
|
||||||
|
|
||||||
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
|
await JsRuntime.InvokeVoidAsync("copyToClipboard", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task DownloadImage()
|
||||||
|
{
|
||||||
|
await JsRuntime.InvokeVoidAsync("downloadImage", $"data:image/png;base64,{ImageSource}", "QRCode.jpg");
|
||||||
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
var productOwner = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesById, Context.ServiceProviderId);
|
var productOwner = await AdminSignalRClient.GetByIdAsync<List<Company>>(SignalRTags.GetCompaniesById, Context.ServiceProviderId);
|
||||||
|
|
@ -158,7 +157,6 @@
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
|
|
||||||
await base.OnParametersSetAsync();
|
await base.OnParametersSetAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,8 +175,6 @@
|
||||||
|
|
||||||
private bool CheckDestinations(Guid addressId)
|
private bool CheckDestinations(Guid addressId)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (destinations != null)
|
if (destinations != null)
|
||||||
{
|
{
|
||||||
if (destinations.Any(d => d.AddressId == addressId))
|
if (destinations.Any(d => d.AddressId == addressId))
|
||||||
|
|
@ -194,7 +190,6 @@
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SaveAsDestination(Address address, Product product)
|
private async Task SaveAsDestination(Address address, Product product)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,7 @@ namespace TIAMSharedUI.Shared.Components.BaseComponents
|
||||||
{
|
{
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
_logger = new LoggerClient<UserBasePageComponent>(_logWriters.ToArray());
|
_logger = new LoggerClient<UserBasePageComponent>(_logWriters.ToArray());
|
||||||
var currentUrl = _navManager.ToBaseRelativePath(_navManager.Uri);
|
|
||||||
_pageState.AddPageToHistory(currentUrl);
|
|
||||||
_logger.Debug(_pageState.GetGoBackPage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue