From 93db033377b5e457bd04daf0b16f3d8b8cd77b44 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 22 Aug 2025 17:39:57 +0200 Subject: Room upgrade CLI changes, policy list work --- .../PolicyListCategoryComponent.razor | 5 ++++- .../PolicyListRowComponent.razor | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'MatrixUtils.Web/Pages/Rooms/PolicyListComponents') diff --git a/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListCategoryComponent.razor b/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListCategoryComponent.razor index f818b62..b52e03f 100644 --- a/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListCategoryComponent.razor +++ b/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListCategoryComponent.razor @@ -18,7 +18,7 @@ @foreach (var policy in PolicyCollection.ActivePolicies.Values.OrderBy(x => x.Policy.RawContent?["entity"]?.GetValue())) { - + } @@ -56,6 +56,9 @@ [Parameter] public required GenericRoom Room { get; set; } + + [Parameter] + public bool RenderEventInfo { get; set; } protected override bool ShouldRender() { // if (PolicyCollection is null) return false; diff --git a/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListRowComponent.razor b/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListRowComponent.razor index 11de82c..9ac5077 100644 --- a/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListRowComponent.razor +++ b/MatrixUtils.Web/Pages/Rooms/PolicyListComponents/PolicyListRowComponent.razor @@ -10,9 +10,19 @@ if (prop.Name == "Entity") { @TruncateMxid(TypedContent.Entity) + @foreach (var dup in PolicyInfo.DuplicatedBy) { +
+ Duplicated by @dup.FriendlyTypeName.ToLower() @TruncateMxid(dup.RawContent["entity"]?.GetValue()) + } @foreach (var dup in PolicyInfo.MadeRedundantBy) {
- Also matched by @dup.FriendlyTypeName.ToLower() @TruncateMxid(dup.RawContent["entity"].GetValue()) + Also matched by @dup.FriendlyTypeName.ToLower() @TruncateMxid(dup.RawContent["entity"]?.GetValue()) + } + @if (RenderEventInfo) { +
+
+                            @PolicyInfo.Policy.Type/@PolicyInfo.Policy.StateKey by @PolicyInfo.Policy.Sender at @PolicyInfo.Policy.OriginServerTs 
+                        
} } @@ -25,9 +35,9 @@ @* @if (PowerLevels.UserHasStatePermission(Homeserver.WhoAmI.UserId, Policy.Type)) { *@ @if (true) { Edit + IsEditing = true; + return Task.CompletedTask; + })">Edit Remove @if (Policy.IsLegacyType) { @@ -82,6 +92,9 @@ [Parameter] public required PolicyList.PolicyCollection PolicyCollection { get; set; } + [Parameter] + public bool RenderEventInfo { get; set; } + private StateEventResponse Policy => PolicyInfo.Policy; private bool IsEditing { -- cgit 1.5.1