@@ -180,98 +180,6 @@ function DiffViewDocument ({documentID,diffObj, CRObject,propertyModifiedCount,f
180180</ Accordion >
181181}
182182
183- /**
184- *
185- * @param {* } diffs diff list
186- * @param {* } trackingBranchDocumentList document list of tracking branch
187- * @param {* } originBranchDocumentList document list of origin branch
188- * @returns
189- */
190- export const DiffView_OLD = ( { diffs, CRObject, start, setStart } ) => {
191- const { woqlClient} = WOQLClientObj ( )
192-
193- // I need to copy the woqlClient and set the original_branch
194- // to get the right frame
195- const woqlClientCopy = woqlClient . copy ( )
196- woqlClientCopy . checkout ( CRObject . original_branch )
197-
198- const { frames, getDocumentFrames} = useTDBDocuments ( woqlClientCopy )
199- // pagination constants
200- const [ activePage , setActivePage ] = useState ( 1 )
201- const [ current , setCurrent ] = useState ( 0 )
202-
203- const [ page , setPage ] = useState ( start )
204-
205- let elements = [ ] , paginationItems = [ ]
206-
207- let divide = Math . ceil ( diffs . length / DIFFS_PER_PAGE_LIMIT )
208-
209- useEffect ( ( ) => {
210- getDocumentFrames ( )
211- } , [ ] )
212- // function to handle on click of page
213- function handlePagination ( number ) {
214- alert ( number )
215- /*let position=DIFFS_PER_PAGE_LIMIT * (number-1)
216-
217- setCurrent(position)
218- setActivePage(number) */
219-
220- }
221-
222- // populate pagination Item
223- /*for (let number = 1; number <= divide; number++) {
224- paginationItems.push(
225- <Pagination.Item key={number} active={number === activePage} onClick={(e) => handlePagination(number)}>
226- {number}
227- </Pagination.Item>
228- )
229- }*/
230-
231- if ( ! frames ) return < Loading message = { `Loading Frames ...` } />
232- if ( ! diffs ) return < Loading message = { `Loading Diffs ...` } />
233-
234-
235- // looping through diff lists
236- for ( let start = current ; start < ( current + DIFFS_PER_PAGE_LIMIT ) ; start ++ ) {
237-
238- if ( start >= diffs . length ) continue
239-
240- const propertyModifiedCount = getPropertyModifiedCount ( diffs [ start ] )
241- const diffObj = diffs [ start ]
242- const action = diffObj [ "@op" ] || "Change"
243- const actionKey = `@${ action . toLowerCase ( ) } `
244- const eventKey = diffObj [ actionKey ] && diffObj [ actionKey ] [ "@id" ] ? diffObj [ actionKey ] [ "@id" ] : diffObj [ "@id" ]
245- const docType = diffObj [ actionKey ] && diffObj [ actionKey ] [ "@type" ] ? diffObj [ actionKey ] [ "@type" ] : diffObj [ "@type" ]
246-
247- // this are the diff panel for document
248- elements . push (
249- < React . Fragment key = { `item__${ start } ` } >
250- < DiffViewDocument frames = { frames } key = { actionKey }
251- action = { action }
252- docType = { docType }
253- propertyModifiedCount = { propertyModifiedCount }
254- documentID = { eventKey }
255- diffObj = { diffObj }
256- CRObject = { CRObject } />
257- </ React . Fragment >
258- )
259- }
260-
261- return < React . Fragment >
262- { elements }
263- < Row className = "w-100" >
264- < Col />
265- < Col >
266- < Pagination className = "justify-content-center " >
267- < Pagination . Prev onClick = { ( e ) => handlePagination ( e ) } />
268- < Pagination . Next onClick = { ( e ) => handlePagination ( e ) } />
269- </ Pagination >
270- </ Col >
271- < Col />
272- </ Row >
273- </ React . Fragment >
274- }
275183
276184/**
277185 *
@@ -292,7 +200,7 @@ export const DiffView = ({diffs, CRObject, start, setStart }) => {
292200
293201 let elements = [ ]
294202
295-
203+
296204 useEffect ( ( ) => {
297205 getDocumentFrames ( )
298206 } , [ ] )
0 commit comments