Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useVeltClient, VeltComments } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments } from "@veltdev/react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
import { useEffect } from "react";
Expand All @@ -9,6 +9,8 @@ export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
// [Velt] Get Velt client instance
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

// [Velt] Sign out user when user logs out, getting user login state from host app
useEffect(() => {
Expand All @@ -20,15 +22,17 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
priority={true}
/>
{veltInitialized && (
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
priority={true}
/>
)}

<VeltCustomization />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
import { useEffect } from "react";
Expand All @@ -9,6 +9,8 @@ export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
// [Velt] Get Velt client instance
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

// [Velt] Sign out user when user logs out, getting user login state from host app
useEffect(() => {
Expand All @@ -24,16 +26,20 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
/>
<VeltCommentsSidebar shadowDom={false} groupConfig={groupConfig} pageMode={true} sortData="asc" />
{veltInitialized && (
<>
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
/>
<VeltCommentsSidebar shadowDom={false} groupConfig={groupConfig} pageMode={true} sortData="asc" />
</>
)}

<VeltCustomization />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { useAppUser } from "@/app/userAuth/AppUserContext";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useEffect } from "react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
Expand All @@ -10,6 +10,8 @@ export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
// [Velt] Get Velt client instance
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

const selectedJob = useSelectedJob();

Expand All @@ -27,25 +29,29 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
// readOnly={true} // Uncomment this to make the comments read-only for certain users
/>
<VeltCommentsSidebar
context={{ jobId: selectedJob?.id, jobName: selectedJob?.jobName, jobStatus: selectedJob?.status, commentType: 'jobLevel' }}
shadowDom={false}
groupConfig={groupConfig}
pageMode={true}
sortData="asc"
focusedThreadMode={true}
// readOnly={true}
/>
{veltInitialized && (
<>
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
// readOnly={true} // Uncomment this to make the comments read-only for certain users
/>
<VeltCommentsSidebar
context={{ jobId: selectedJob?.id, jobName: selectedJob?.jobName, jobStatus: selectedJob?.status, commentType: 'jobLevel' }}
shadowDom={false}
groupConfig={groupConfig}
pageMode={true}
sortData="asc"
focusedThreadMode={true}
// readOnly={true}
/>
</>
)}

<VeltCustomization />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { useAppUser } from "@/app/userAuth/AppUserContext";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useEffect } from "react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
Expand All @@ -10,6 +10,8 @@ export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
// [Velt] Get Velt client instance
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

const selectedJob = useSelectedJob();

Expand All @@ -27,25 +29,29 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
// readOnly={true} // Uncomment this to make the comments read-only for certain users
/>
<VeltCommentsSidebar
context={{ jobId: selectedJob?.id, jobName: selectedJob?.jobName, jobStatus: selectedJob?.status, commentType: 'jobLevel' }}
shadowDom={false}
groupConfig={groupConfig}
pageMode={true}
sortData="asc"
focusedThreadMode={true}
// readOnly={true}
/>
{veltInitialized && (
<>
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
// readOnly={true} // Uncomment this to make the comments read-only for certain users
/>
<VeltCommentsSidebar
context={{ jobId: selectedJob?.id, jobName: selectedJob?.jobName, jobStatus: selectedJob?.status, commentType: 'jobLevel' }}
shadowDom={false}
groupConfig={groupConfig}
pageMode={true}
sortData="asc"
focusedThreadMode={true}
// readOnly={true}
/>
</>
)}

<VeltCustomization />
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
import { useEffect } from "react";
Expand All @@ -9,6 +9,8 @@ export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
// [Velt] Get Velt client instance
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

// [Velt] Sign out user when user logs out, getting user login state from host app
useEffect(() => {
Expand All @@ -24,17 +26,21 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
priority={true}
/>
<VeltCommentsSidebar groupConfig={groupConfig} />
{veltInitialized && (
<>
<VeltComments
popoverTriangleComponent={false}
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
groupMatchedComments={true}
priority={true}
/>
<VeltCommentsSidebar groupConfig={groupConfig} />
</>
)}
<VeltCustomization />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
import { useEffect } from "react";
Expand All @@ -8,6 +8,8 @@ import { useAppUser } from "@/app/userAuth/AppUserContext";
export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

// [Velt] Sign out user when user logs out, getting user login state from host app
useEffect(() => {
Expand All @@ -23,14 +25,18 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
<VeltComments
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
/>
<VeltCommentsSidebar groupConfig={groupConfig} />
{veltInitialized && (
<>
<VeltComments
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
/>
<VeltCommentsSidebar groupConfig={groupConfig} />
</>
)}
<VeltCustomization />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useVeltClient, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import { useVeltClient, useVeltInitState, VeltComments, VeltCommentsSidebar } from "@veltdev/react";
import VeltInitializeDocument from "./VeltInitializeDocument";
import { VeltCustomization } from "./ui-customization/VeltCustomization";
import { useEffect } from "react";
Expand All @@ -8,6 +8,8 @@ import { useAppUser } from "@/app/userAuth/AppUserContext";
export function VeltCollaboration() {
const { isUserLoggedIn } = useAppUser();
const { client } = useVeltClient();
// [Velt] Check if Velt is fully initialized (user authenticated + document set)
const veltInitialized = useVeltInitState();

// [Velt] Sign out user when user logs out, getting user login state from host app
useEffect(() => {
Expand All @@ -23,16 +25,20 @@ export function VeltCollaboration() {
return (
<>
<VeltInitializeDocument />
{/* [Velt] Enable comments in popover mode */}
<VeltComments
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
/>
{/* [Velt] Comments sidebar panel */}
<VeltCommentsSidebar groupConfig={groupConfig} />
{veltInitialized && (
<>
{/* [Velt] Enable comments in popover mode */}
<VeltComments
popoverMode={true}
shadowDom={false}
textMode={false}
commentPinHighlighter={false}
dialogOnHover={false}
/>
{/* [Velt] Comments sidebar panel */}
<VeltCommentsSidebar groupConfig={groupConfig} />
</>
)}
<VeltCustomization />
</>
);
Expand Down
Loading
Loading