feat(06-04): update TransferViewModel for global site consumption; confirm BulkMembers excluded

- TransferViewModel: add _hasLocalSourceSiteOverride field
- Override OnGlobalSitesChanged to pre-fill SourceSiteUrl from first global site
- Add OnSourceSiteUrlChanged partial to detect local user input
- Reset _hasLocalSourceSiteOverride on tenant switch
- BulkMembersViewModel confirmed excluded: no SiteUrl field, CSV-driven, no OnGlobalSitesChanged override added
This commit is contained in:
Dev
2026-04-07 10:08:52 +02:00
parent 9a4365bd32
commit 0a91dd4ff3

View File

@@ -17,6 +17,7 @@ public partial class TransferViewModel : FeatureViewModelBase
private readonly BulkResultCsvExportService _exportService;
private readonly ILogger<FeatureViewModelBase> _logger;
private TenantProfile? _currentProfile;
private bool _hasLocalSourceSiteOverride;
// Source selection
[ObservableProperty] private string _sourceSiteUrl = string.Empty;
@@ -61,6 +62,26 @@ public partial class TransferViewModel : FeatureViewModelBase
ExportFailedCommand = new AsyncRelayCommand(ExportFailedAsync, () => HasFailures);
}
protected override void OnGlobalSitesChanged(IReadOnlyList<SiteInfo> sites)
{
if (_hasLocalSourceSiteOverride) return;
SourceSiteUrl = sites.Count > 0 ? sites[0].Url : string.Empty;
}
partial void OnSourceSiteUrlChanged(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
_hasLocalSourceSiteOverride = false;
if (GlobalSites.Count > 0)
SourceSiteUrl = GlobalSites[0].Url;
}
else if (GlobalSites.Count == 0 || value != GlobalSites[0].Url)
{
_hasLocalSourceSiteOverride = true;
}
}
protected override async Task RunOperationAsync(CancellationToken ct, IProgress<OperationProgress> progress)
{
if (_currentProfile == null)
@@ -152,6 +173,7 @@ public partial class TransferViewModel : FeatureViewModelBase
protected override void OnTenantSwitched(TenantProfile profile)
{
_currentProfile = profile;
_hasLocalSourceSiteOverride = false;
SourceSiteUrl = string.Empty;
SourceLibrary = string.Empty;
SourceFolderPath = string.Empty;