@if (SearchText.Length > 0)
{
- foreach (var searchSection in searchService.Searches)
+ foreach (var searchSection in SearchService.Searches)
{
var searchPoints = searchSection.Value.FindAll(x => x.Title.ToLower().Contains(SearchText.ToLower()));
@@ -141,7 +141,7 @@
protected override void OnInitialized()
{
- searchService.Subscribe(OnSearchChanged);
+ SearchService.Subscribe(OnSearchChanged);
timer = new Timer(200);
timer.Elapsed += FocusTimer;
@@ -151,7 +151,7 @@
private void FocusTimer(object? sender, ElapsedEventArgs e)
{
- jsRuntime.InvokeVoidAsync("SetFocusToElement", "searchInput");
+ JsRuntime.InvokeVoidAsync("SetFocusToElement", "searchInput");
StateHasChanged();
}
@@ -159,9 +159,9 @@
private void OnSearchChanged()
{
- if (timer.Enabled != searchService.IsVisible)
+ if (timer.Enabled != SearchService.IsVisible)
{
- timer.Enabled = searchService.IsVisible;
+ timer.Enabled = SearchService.IsVisible;
}
StateHasChanged();
@@ -169,26 +169,26 @@
public void Dispose()
{
- searchService.Unsubscribe(OnSearchChanged);
+ SearchService.Unsubscribe(OnSearchChanged);
timer.Elapsed -= FocusTimer;
}
public void CloseDialog()
{
- searchService.Hide();
+ SearchService.Hide();
}
public void NavigateTo(string url)
{
if (url.Contains("#"))
{
- navigationManager.NavigateTo(url,
- navigationManager.Uri.Split("#").First().Contains(url.Split("#").First()));
+ NavigationManager.NavigateTo(url,
+ NavigationManager.Uri.Split("#").First().Contains(url.Split("#").First()));
}
else
{
- navigationManager.NavigateTo(url);
+ NavigationManager.NavigateTo(url);
}
}
@@ -200,7 +200,7 @@
private void OnSearch(SearchPointModel searchPoint)
{
NavigateTo(searchPoint.Href);
- searchService.Hide();
+ SearchService.Hide();
}
private void OnFocus(object obj)
diff --git a/IGP/Portals/TooltipPortal.razor b/IGP/Portals/TooltipPortal.razor
new file mode 100644
index 0000000..1b19562
--- /dev/null
+++ b/IGP/Portals/TooltipPortal.razor
@@ -0,0 +1,46 @@
+@implements IDisposable;
+
+@inject ITooltipService TooltipService
+
+@if (TooltipService.HasTooltips())
+{
+
+ @foreach (var tooltip in Tooltips)
+ {
+
+ }
+
+}
+
+
+
+
+@code {
+ private List
Tooltips => TooltipService.GetTooltips();
+
+ protected override void OnInitialized()
+ {
+ base.OnInitialized();
+ TooltipService.Subscribe(OnUpdate);
+ }
+
+ void IDisposable.Dispose()
+ {
+ TooltipService.Unsubscribe(OnUpdate);
+ }
+
+ void OnUpdate()
+ {
+ StateHasChanged();
+ }
+
+}
\ No newline at end of file
diff --git a/Model/Feedback/TooltipModel.cs b/Model/Feedback/TooltipModel.cs
new file mode 100644
index 0000000..6c02ffe
--- /dev/null
+++ b/Model/Feedback/TooltipModel.cs
@@ -0,0 +1,6 @@
+namespace Model.Feedback;
+
+public class TooltipModel
+{
+ public string Message { get; set; } = "addMessage";
+}
\ No newline at end of file
diff --git a/Services/IServices.cs b/Services/IServices.cs
index 2e679a1..226ea11 100644
--- a/Services/IServices.cs
+++ b/Services/IServices.cs
@@ -11,6 +11,17 @@ using Services.Website;
namespace Services;
+public interface ITooltipService
+{
+ public void Subscribe(Action action);
+ public void Unsubscribe(Action action);
+ void AddTooltip(TooltipModel tooltip);
+ void RemoveTooltip(TooltipModel tooltip);
+ bool HasTooltips();
+ List GetTooltips();
+ void ClearAllTooltips();
+}
+
public interface IToastService
{
public void Subscribe(Action action);
diff --git a/Services/Website/TooltipService.cs b/Services/Website/TooltipService.cs
new file mode 100644
index 0000000..74a0fb6
--- /dev/null
+++ b/Services/Website/TooltipService.cs
@@ -0,0 +1,54 @@
+using Model.Feedback;
+
+namespace Services.Website;
+
+public class TooltipService : ITooltipService
+{
+ private readonly List tooltips = new();
+
+ public void Subscribe(Action action)
+ {
+ OnChange += action;
+ }
+
+ public void Unsubscribe(Action action)
+ {
+ OnChange += action;
+ }
+
+ public void AddTooltip(TooltipModel tooltip)
+ {
+ tooltips.Insert(0, tooltip);
+
+ NotifyDataChanged();
+ }
+
+ public void RemoveTooltip(TooltipModel tooltip)
+ {
+ tooltips.Remove(tooltip);
+ }
+
+ public bool HasTooltips()
+ {
+ return tooltips.Count > 0;
+ }
+
+ public List GetTooltips()
+ {
+ return tooltips;
+ }
+
+
+ public void ClearAllTooltips()
+ {
+ tooltips.Clear();
+ NotifyDataChanged();
+ }
+
+ private event Action OnChange = null!;
+
+ private void NotifyDataChanged()
+ {
+ OnChange();
+ }
+}
\ No newline at end of file