@@ -14,6 +14,7 @@ import {BsPlus} from "react-icons/bs"
1414import { BiMinusCircle } from "react-icons/bi"
1515import { Loading } from "./Loading"
1616import { WOQLClientObj } from '../init-woql-client'
17+ import { getTypenameFromStoreObject } from "@apollo/client/cache/inmemory/helpers"
1718/**
1819 *
1920 * @param {* } diff diff list
@@ -111,9 +112,10 @@ function DiffViewDocument ({documentID,diffObj, CRObject,propertyModifiedCount,f
111112 const { woqlClient } = WOQLClientObj ( )
112113
113114 const { getDocumentByBranches,
114- error,
115- originalValue,
116- changedValue} = useDiff ( )
115+ error,
116+ originalValue,
117+ changedValue,
118+ setChangedValue} = useDiff ( )
117119
118120 const [ clicked , setClicked ] = useState ( false )
119121
@@ -132,6 +134,17 @@ function DiffViewDocument ({documentID,diffObj, CRObject,propertyModifiedCount,f
132134 function handleTraverse ( documentID ) {
133135 onTraverse ( documentID , setClicked )
134136 }
137+
138+ /*useEffect(() => {
139+ async function getChangedValue() {
140+ const clientCopy = woqlClient.copy()
141+ // apply patch on original value to get changed value
142+ // to get Sets in same order as that of original value
143+ let changedValueResult=await clientCopy.patch(originalValue, diffObj)
144+ if(setChangedValue) setChangedValue(changedValueResult)
145+ }
146+ if(diffObj && originalValue && woqlClient) getChangedValue()
147+ }, [diffObj, originalValue, woqlClient])*/
135148
136149 return < Accordion className = "accordion__button padding-0 diff__accordian mb-3" id = { eventKey } onSelect = { getDocumentStatesOnClick } >
137150 < Accordion . Item eventKey = { eventKey } className = "border-0" >
@@ -163,8 +176,8 @@ function DiffViewDocument ({documentID,diffObj, CRObject,propertyModifiedCount,f
163176 onHide = { ( ) => setClicked ( false ) } /> }
164177 { originalValue && changedValue &&
165178 < DiffViewer
166- oldValue = { originalValue }
167- newValue = { changedValue }
179+ oldValue = { originalValue } //original
180+ newValue = { changedValue } // changed
168181 oldValueHeader = { < OriginHeader branch = "main" /> }
169182 newValueHeader = { < TrackingHeader branch = { CRObject . name } /> }
170183 frame = { frames }
0 commit comments