1515 v-model =" newComment"
1616 type =" textarea"
1717 color =" purple-4"
18- :disable =" !selection"
19- :label =" !selection ? 'Select a file and source lines to add comments' : undefined"
18+ :disable =" !selection || readonly"
19+ :label ="
20+ readonly
21+ ? 'This is a readonly demo workspace'
22+ : !selection
23+ ? 'Select a file and source lines to add comments'
24+ : undefined
25+ "
2026 :bg-color =" dark ? 'grey-10' : 'purple-1'"
2127 @keydown.enter =" addComment"
2228 outlined
4450 <QBtn
4551 color =" accent"
4652 :icon =" tabMessagePlus"
47- :disable =" newComment.trim().length === 0"
53+ :disable ="
54+ newComment.trim().length === 0 || candidate.workspaceUid === demoWorkspaceId
55+ "
4856 @click =" addComment()"
4957 />
5058 </QItemSection >
8391 <WorkspaceCommentCard
8492 v-for =" comment in filteredComments"
8593 :comment-states =" commentCollapsed"
86- :comment =" comment"
94+ :comment
95+ :readonly
8796 @expand =" commentCollapsed[comment.rootComment.uid] = false"
8897 @collapse =" commentCollapsed[comment.rootComment.uid] = true"
8998 />
@@ -122,9 +131,12 @@ import {
122131import { QBtn , scroll } from " quasar" ;
123132import { btnProps } from " ../../utils/commonProps" ;
124133import { modifier } from " ~/composables/useCommandPalette" ;
134+ import { demoWorkspaceId } from " ../../utils/environment" ;
125135
126136const $q = useQuasar ();
127137
138+ const $route = useRoute ();
139+
128140const { getScrollTarget, setVerticalScrollPosition } = scroll ;
129141
130142const topBtn = ref <QBtn >();
@@ -145,6 +157,15 @@ const commentCollapsed = reactive<Record<string, boolean>>({});
145157
146158const showBackToTop = ref (false );
147159
160+ /**
161+ * Readonly for the demo workspace except in edit mode.
162+ */
163+ const readonly = computed (
164+ () =>
165+ candidate .value .workspaceUid === demoWorkspaceId &&
166+ $route .path !== ` /workspace/${demoWorkspaceId }/c/${demoCandidateId } `
167+ );
168+
148169const comments = computed <CommentChain []>(() => {
149170 const replies: Record <string , ReviewComment []> = {};
150171
0 commit comments