diff --git a/dotnet/AipsRT/Model/Whiteboard/GetWhiteboardService.cs b/dotnet/AipsRT/Model/Whiteboard/GetWhiteboardService.cs index 68f72ed..593ae1b 100644 --- a/dotnet/AipsRT/Model/Whiteboard/GetWhiteboardService.cs +++ b/dotnet/AipsRT/Model/Whiteboard/GetWhiteboardService.cs @@ -28,7 +28,8 @@ public class GetWhiteboardService { WhiteboardId = entity.Id, OwnerId = entity.OwnerId, - Owner = new User(entity.Owner.Id, entity.Owner.UserName!, entity.Owner.Email!) + Owner = new User(entity.Owner.Id, entity.Owner.UserName!, entity.Owner.Email!), + Code = entity.Code, }; foreach (var membership in entity.Memberships) diff --git a/dotnet/AipsRT/Model/Whiteboard/Whiteboard.cs b/dotnet/AipsRT/Model/Whiteboard/Whiteboard.cs index fa8bc5f..711ff49 100644 --- a/dotnet/AipsRT/Model/Whiteboard/Whiteboard.cs +++ b/dotnet/AipsRT/Model/Whiteboard/Whiteboard.cs @@ -9,6 +9,8 @@ public class Whiteboard public Guid OwnerId { get; set; } public User Owner { get; set; } = null!; + + public string Code {get; set;} public List Users { get; } = []; diff --git a/front/src/components/whiteboard/WhiteboardToolbar.vue b/front/src/components/whiteboard/WhiteboardToolbar.vue index 23739ed..492c9ac 100644 --- a/front/src/components/whiteboard/WhiteboardToolbar.vue +++ b/front/src/components/whiteboard/WhiteboardToolbar.vue @@ -23,6 +23,12 @@ const colors = ['#4f9dff', '#ff4f4f', '#4fff4f', '#ffff4f', '#ff4fff', '#ffffff' const isReadOnly = computed(() => sessionStore.selectedTool === 'hand' && !!sessionStore.selectedShape) +const isOwner = computed(() => { + const wb = sessionStore.whiteboard + if (!wb || !auth.user) return false + return wb.ownerId === auth.user.userId +}) + const showProperties = computed(() => { if (['rectangle', 'arrow', 'line', 'text'].includes(sessionStore.selectedTool)) return true if (sessionStore.selectedTool === 'hand' && sessionStore.selectedShape) return true @@ -61,7 +67,7 @@ const displayTextSize = computed(() => { const showCopiedTooltip = ref(false) -const whiteboardCode = computed(() => infoStore.getCurrentWhiteboard()?.code || '') +const whiteboardCode = computed(() => sessionStore.whiteboard!.code) const copyCodeToClipboard = async () => { console.info(whiteboardCode.value) @@ -166,7 +172,7 @@ const copyCodeToClipboard = async () => { -
+