Skip to content

Commit

Permalink
fix: Made web external links clickable (#207)
Browse files Browse the repository at this point in the history
* fix: Made web external links clickable

* chore(backoffice): open kbe links in new tab

---------

Co-authored-by: Fenrikur <3359222+Fenrikur@users.noreply.github.com>
  • Loading branch information
Metawolve and Fenrikur authored Sep 2, 2024
1 parent 09d0597 commit 8f249e8
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/Eurofurence.App.Backoffice/Pages/KnowledgeBase.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@using Eurofurence.App.Domain.Model.Knowledge
@using Microsoft.AspNetCore.Authorization
@using Eurofurence.App.Backoffice.Components
@using Eurofurence.App.Domain.Model.Fragments
@using Eurofurence.App.Domain.Model.Images
@using Markdig
@inject ISnackbar Snackbar
Expand Down Expand Up @@ -114,7 +115,15 @@
<MudCardActions>
@foreach (var link in knowledgeEntry.Links)
{
<MudButton Variant="Variant.Text" Color="Color.Primary">@link.Name</MudButton>
@if (link.FragmentType == LinkFragment.FragmentTypeEnum.WebExternal)
{
<MudButton Variant="Variant.Text" Color="Color.Primary" Href="@link.Target" Target="_blank">
@link.Name</MudButton>
}
else
{
<MudButton Disabled="true" Variant="Variant.Text" Color="Color.Primary">@link.Name</MudButton>
}
}
</MudCardActions>
</MudCard>
Expand Down Expand Up @@ -239,10 +248,10 @@
private async Task DeleteKnowledgeEntry(Guid id)
{
DialogParameters<ConfirmDialog> dialog = new()
{
{ x => x.ContentText, $"Are you sure you want to delete this knowledge base entry?" },
{ x => x.ActionButtonText, "Confirm" }
};
{
{ x => x.ContentText, $"Are you sure you want to delete this knowledge base entry?" },
{ x => x.ActionButtonText, "Confirm" }
};
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
IDialogReference dialogRef = await DialogService.ShowAsync<ConfirmDialog>("Confirm", dialog, options);
DialogResult dialogResult = await dialogRef.Result;
Expand Down Expand Up @@ -295,10 +304,10 @@
private async Task DeleteKnowledgeGroup(Guid id)
{
DialogParameters<ConfirmDialog> dialog = new()
{
{ x => x.ContentText, $"Are you sure you want to delete this knowledge base group?" },
{ x => x.ActionButtonText, "Confirm" }
};
{
{ x => x.ContentText, $"Are you sure you want to delete this knowledge base group?" },
{ x => x.ActionButtonText, "Confirm" }
};
var options = new DialogOptions() { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
IDialogReference dialogRef = await DialogService.ShowAsync<ConfirmDialog>("Confirm", dialog, options);
DialogResult dialogResult = await dialogRef.Result;
Expand Down

0 comments on commit 8f249e8

Please sign in to comment.