RED-4490: show copy popup icon

This commit is contained in:
Dan Percic 2022-07-04 18:23:27 +03:00
parent 6a40fa9802
commit f5773df6d0
5 changed files with 2326 additions and 295 deletions

View File

@ -198,53 +198,52 @@ export class FileDataService extends EntitiesService<AnnotationWrapper> {
changeLogType: ChangeType;
isChangeLogEntry: boolean;
} {
if (file.numberOfAnalyses > 1) {
const viableChanges = redactionLogEntry.changes.filter(c => c.analysisNumber > 1);
viableChanges.sort((a, b) => dayjs(a.dateTime).valueOf() - dayjs(b.dateTime).valueOf());
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();
// page has been seen -> let's see if it's a change
if (viewedPage) {
const viewTime = dayjs(viewedPage.viewedTime).valueOf() - DELTA_VIEW_TIME;
// these are all unseen changes
const relevantChanges = viableChanges.filter(change => dayjs(change.dateTime).valueOf() > viewTime);
// at least one unseen change
if (relevantChanges.length > 0) {
// at least 1 relevant change
viewedPage.showAsUnseen = dayjs(viewedPage.viewedTime).valueOf() < dayjs(lastChange.dateTime).valueOf();
this.hasChangeLog$.next(true);
return {
changeLogType: relevantChanges[relevantChanges.length - 1].type,
isChangeLogEntry: true,
hidden: false,
};
} else {
// no relevant changes - hide removed anyway
return {
changeLogType: null,
isChangeLogEntry: false,
hidden: lastChange && lastChange.type === 'REMOVED',
};
}
} else {
// Page doesn't have a view-time
return {
changeLogType: null,
isChangeLogEntry: false,
hidden: lastChange && lastChange.type === 'REMOVED',
};
}
} else {
if (file.numberOfAnalyses <= 1) {
return {
changeLogType: null,
isChangeLogEntry: false,
hidden: false,
};
}
// console.log(wrapper.changeLogType, wrapper.hidden, wrapper.isChangeLogEntry, wrapper.value, lastChange);
const viableChanges = redactionLogEntry.changes.filter(c => c.analysisNumber > 1);
viableChanges.sort((a, b) => dayjs(a.dateTime).valueOf() - dayjs(b.dateTime).valueOf());
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();
// page has been seen -> let's see if it's a change
if (viewedPage) {
const viewTime = dayjs(viewedPage.viewedTime).valueOf() - DELTA_VIEW_TIME;
// these are all unseen changes
const relevantChanges = viableChanges.filter(change => dayjs(change.dateTime).valueOf() > viewTime);
// at least one unseen change
if (relevantChanges.length > 0) {
// at least 1 relevant change
viewedPage.showAsUnseen = dayjs(viewedPage.viewedTime).valueOf() < dayjs(lastChange.dateTime).valueOf();
this.hasChangeLog$.next(true);
return {
changeLogType: relevantChanges[relevantChanges.length - 1].type,
isChangeLogEntry: true,
hidden: false,
};
}
// no relevant changes - hide removed anyway
return {
changeLogType: null,
isChangeLogEntry: false,
hidden: lastChange && lastChange.type === 'REMOVED',
};
}
// Page doesn't have a view-time
return {
changeLogType: null,
isChangeLogEntry: false,
hidden: lastChange && lastChange.type === 'REMOVED',
};
}
}

View File

@ -220,7 +220,6 @@ export class PdfViewer {
}
configureTextPopups(popups: IHeaderElement[]) {
this.#instance.UI.textPopup.update([]);
this.#instance.UI.textPopup.add([...popups, this.#searchButton]);
}

15
nx.json
View File

@ -22,14 +22,6 @@
}
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
},
"cli": {
"analytics": false,
"packageManager": "yarn"
@ -46,5 +38,10 @@
},
"@nrwl/angular:component": {}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json"
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
}
}
}

View File

@ -38,7 +38,7 @@
"@ngneat/until-destroy": "^9.2.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@nrwl/angular": "14.3.2",
"@nrwl/angular": "14.4.0",
"@pdftron/webviewer": "8.6.0",
"@swimlane/ngx-charts": "^20.0.1",
"@tabuckner/material-dayjs-adapter": "2.0.0",
@ -65,19 +65,17 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "14.0.1",
"@angular-eslint/eslint-plugin": "13.5.0",
"@angular-eslint/eslint-plugin-template": "13.5.0",
"@angular-eslint/template-parser": "13.5.0",
"@angular-eslint/eslint-plugin": "14.0.0",
"@angular-eslint/eslint-plugin-template": "14.0.0",
"@angular-eslint/template-parser": "14.0.0",
"@angular/cli": "~14.0.0",
"@angular/compiler-cli": "14.0.1",
"@angular/language-service": "14.0.1",
"@bartholomej/ngx-translate-extract": "^8.0.2",
"@nrwl/cli": "14.3.2",
"@nrwl/eslint-plugin-nx": "14.3.2",
"@nrwl/linter": "14.3.2",
"@nrwl/workspace": "14.3.2",
"@types/google.visualization": "^0.0.68",
"@types/jest": "28.1.1",
"@nrwl/cli": "14.4.0",
"@nrwl/eslint-plugin-nx": "14.4.0",
"@nrwl/linter": "14.4.0",
"@nrwl/workspace": "14.4.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "17.0.42",
"@typescript-eslint/eslint-plugin": "5.24.0",
@ -93,7 +91,7 @@
"google-translate-api-browser": "^1.1.71",
"husky": "^8.0.1",
"lint-staged": "^13.0.2",
"nx": "14.3.2",
"nx": "14.4.0",
"postcss": "^8.4.14",
"postcss-import": "14.1.0",
"postcss-preset-env": "~7.7.1",

2502
yarn.lock

File diff suppressed because it is too large Load Diff