Fixed site discovery process that did not return all the sites

This commit is contained in:
2026-06-04 11:32:34 +02:00
parent 95aca34b31
commit ce2f0512cb
10 changed files with 315 additions and 58 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
<aside class="sidebar @(_sidebarCollapsed ? "collapsed" : "")">
<div class="sidebar-header">
<div class="logo">
<span class="logo-mark">SP</span>
<img class="logo-mark" src="SPToolbox-logo-ico.png" alt="SP Toolbox" />
<span class="logo-text">SP Toolbox</span>
</div>
<button class="toggle-btn @(_sidebarCollapsed ? "collapsed" : "")" @onclick="ToggleSidebar" title="@T["nav.toggleSidebar"]"></button>
+19 -11
View File
@@ -1,10 +1,13 @@
@page "/settings"
@attribute [Authorize]
@inject IUserSessionService Session
@inject IUserContextAccessor UserContext
@inject IJSRuntime JS
@inject TranslationSource T
@rendermode InteractiveServer
@using Microsoft.JSInterop
@using SharepointToolbox.Web.Core.Models
@using SharepointToolbox.Web.Services.Session
<h1 class="page-title">@T["tab.settings"]</h1>
@@ -22,6 +25,7 @@
<select class="form-select" style="width:160px" @bind="_theme" @bind:after="Save">
<option value="System">@T["settings.theme.system"]</option>
<option value="Light">@T["settings.theme.light"]</option>
<option value="Dark">@T["settings.theme.dark"]</option>
</select>
</div>
</div>
@@ -36,14 +40,18 @@
</div>
</div>
<div class="card">
<div class="card-title">@T["settings.section.branding"]</div>
<div class="form-group">
<label class="form-label">@T["settings.logo.title"]</label>
<p class="text-muted" style="margin-top:0">@T["settings.logo.description"]</p>
<LogoUpload Value="_mspLogo" ValueChanged="OnMspLogoChanged" />
@if (UserContext.Role == UserRole.Admin)
{
@* MSP branding is shared (global settings file) — only Admins set it for everyone. *@
<div class="card">
<div class="card-title">@T["settings.section.branding"]</div>
<div class="form-group">
<label class="form-label">@T["settings.logo.title"]</label>
<p class="text-muted" style="margin-top:0">@T["settings.logo.description"]</p>
<LogoUpload Value="_mspLogo" ValueChanged="OnMspLogoChanged" />
</div>
</div>
</div>
}
@if (_saved) { <div class="alert alert-success">@T["settings.saved"]</div> }
@@ -55,10 +63,10 @@
protected override void OnInitialized()
{
var s = Session.Settings;
// Reflect the culture actually resolved for this circuit (cookie-driven), not the
// possibly-not-yet-loaded persisted setting.
_lang = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "fr" ? "fr" : "en";
_theme = s.Theme is "System" or "Light" ? s.Theme : "System";
// Read the persisted language directly — the interactive circuit doesn't reliably inherit
// ambient CurrentUICulture (see TranslationSource), so reading it here shows the wrong value.
_lang = s.Lang is "fr" or "en" ? s.Lang : "fr";
_theme = s.Theme is "System" or "Light" or "Dark" ? s.Theme : "System";
_autoTakeOwnership = s.AutoTakeOwnership;
_mspLogo = s.MspLogo;
}