added analysisNumber for delta
This commit is contained in:
parent
dde62588f9
commit
df4d549307
@ -1,4 +1,4 @@
|
||||
import { Dictionary, File, IRedactionLog, IRedactionLogEntry, IViewedPage, User, ViewMode } from '@red/domain';
|
||||
import { Dictionary, File, IRedactionLog, IRedactionLogEntry, IViewedPage, ViewMode } from '@red/domain';
|
||||
import { AnnotationWrapper } from './annotation.wrapper';
|
||||
import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper';
|
||||
import * as moment from 'moment';
|
||||
@ -122,10 +122,10 @@ export class FileDataModel {
|
||||
|
||||
private _isChangeLogEntry(redactionLogEntry: IRedactionLogEntry, wrapper: RedactionLogEntryWrapper) {
|
||||
if (this.file.numberOfAnalyses > 1) {
|
||||
redactionLogEntry.changes.sort((a, b) => moment(a.dateTime).valueOf() - moment(b.dateTime).valueOf());
|
||||
var viableChanges = redactionLogEntry.changes.filter(c => c.analysisNumber > 1);
|
||||
viableChanges.sort((a, b) => moment(a.dateTime).valueOf() - moment(b.dateTime).valueOf());
|
||||
|
||||
const lastChange =
|
||||
redactionLogEntry.changes.length >= 1 ? redactionLogEntry.changes[redactionLogEntry.changes.length - 1] : undefined;
|
||||
const lastChange = viableChanges.length >= 1 ? viableChanges[viableChanges.length - 1] : undefined;
|
||||
const page = redactionLogEntry.positions?.[0].page;
|
||||
|
||||
const viewedPage = this.viewedPages.filter(p => p.page === page).pop();
|
||||
@ -134,7 +134,7 @@ export class FileDataModel {
|
||||
if (viewedPage) {
|
||||
const viewTime = moment(viewedPage.viewedTime).valueOf() - FileDataModel.DELTA_VIEW_TIME;
|
||||
// these are all unseen changes
|
||||
const relevantChanges = redactionLogEntry.changes.filter(change => moment(change.dateTime).valueOf() > viewTime);
|
||||
const relevantChanges = viableChanges.filter(change => moment(change.dateTime).valueOf() > viewTime);
|
||||
// at least one unseen change
|
||||
if (relevantChanges.length > 0) {
|
||||
// at least 1 relevant change
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
export interface IChange {
|
||||
dateTime?: string;
|
||||
analysisNumber?: number;
|
||||
type?: ChangeType;
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import { IRedactionLogEntry } from './redaction-log-entry';
|
||||
|
||||
export interface IRedactionLog {
|
||||
analysisVersion?: number;
|
||||
analysisNumber?: number;
|
||||
dictionaryVersion?: number;
|
||||
dossierDictionaryVersion?: number;
|
||||
legalBasis?: ILegalBasis[];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user