remove arrow parens and arrange code
@ -135,6 +135,7 @@
|
||||
"@typescript-eslint/prefer-function-type": "error",
|
||||
"@typescript-eslint/unified-signatures": "error",
|
||||
"arrow-body-style": "error",
|
||||
"arrow-parens": ["error", "as-needed"],
|
||||
"constructor-super": "error",
|
||||
"eqeqeq": ["error", "smart"],
|
||||
"guard-for-in": "error",
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"arrowParens": "avoid",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "{apps}/**/*.html",
|
||||
|
||||
@ -38,13 +38,12 @@ const routes = [
|
||||
{
|
||||
path: 'main/admin',
|
||||
component: BaseScreenComponent,
|
||||
loadChildren: () => import('./modules/admin/admin.module').then((m) => m.AdminModule)
|
||||
loadChildren: () => import('./modules/admin/admin.module').then(m => m.AdminModule)
|
||||
},
|
||||
{
|
||||
path: 'main/dossiers',
|
||||
component: BaseScreenComponent,
|
||||
loadChildren: () =>
|
||||
import('./modules/dossier/dossiers.module').then((m) => m.DossiersModule)
|
||||
loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule)
|
||||
},
|
||||
{
|
||||
path: 'main/downloads',
|
||||
|
||||
@ -115,7 +115,7 @@ export class AppModule {
|
||||
}
|
||||
|
||||
private _configureKeyCloakRouteHandling() {
|
||||
this._route.queryParamMap.subscribe((queryParams) => {
|
||||
this._route.queryParamMap.subscribe(queryParams => {
|
||||
if (
|
||||
queryParams.has('code') ||
|
||||
queryParams.has('state') ||
|
||||
|
||||
@ -32,7 +32,7 @@ export class NotificationsComponent {
|
||||
}
|
||||
|
||||
get hasUnread() {
|
||||
return this.notifications.filter((notification) => !notification.read).length > 0;
|
||||
return this.notifications.filter(notification => !notification.read).length > 0;
|
||||
}
|
||||
|
||||
day(group: { dateString: string; notifications: Notification[] }): string {
|
||||
|
||||
@ -40,13 +40,13 @@ export class FileDataModel {
|
||||
areDevFeaturesEnabled: boolean
|
||||
): AnnotationData {
|
||||
const entries: RedactionLogEntryWrapper[] = this._convertData(dictionaryData);
|
||||
let allAnnotations = entries.map((entry) => AnnotationWrapper.fromData(entry));
|
||||
let allAnnotations = entries.map(entry => AnnotationWrapper.fromData(entry));
|
||||
|
||||
if (!areDevFeaturesEnabled) {
|
||||
allAnnotations = allAnnotations.filter((annotation) => !annotation.isFalsePositive);
|
||||
allAnnotations = allAnnotations.filter(annotation => !annotation.isFalsePositive);
|
||||
}
|
||||
|
||||
const visibleAnnotations = allAnnotations.filter((annotation) => {
|
||||
const visibleAnnotations = allAnnotations.filter(annotation => {
|
||||
if (viewMode === 'STANDARD') {
|
||||
return !annotation.isChangeLogRemoved;
|
||||
} else if (viewMode === 'DELTA') {
|
||||
@ -67,11 +67,11 @@ export class FileDataModel {
|
||||
}): RedactionLogEntryWrapper[] {
|
||||
let result: RedactionLogEntryWrapper[] = [];
|
||||
|
||||
this.redactionChangeLog?.redactionLogEntry?.forEach((changeLogEntry) => {
|
||||
this.redactionChangeLog?.redactionLogEntry?.forEach(changeLogEntry => {
|
||||
if (changeLogEntry.changeType === 'REMOVED') {
|
||||
// Fix backend issue where some annotations are both added and removed
|
||||
const sameEntryExistsAsAdd = !!this.redactionChangeLog.redactionLogEntry.find(
|
||||
(rle) => rle.id === changeLogEntry.id && rle.changeType === 'ADDED'
|
||||
rle => rle.id === changeLogEntry.id && rle.changeType === 'ADDED'
|
||||
);
|
||||
if (sameEntryExistsAsAdd) {
|
||||
return;
|
||||
@ -92,14 +92,14 @@ export class FileDataModel {
|
||||
}
|
||||
});
|
||||
|
||||
this.redactionLog.redactionLogEntry?.forEach((redactionLogEntry) => {
|
||||
this.redactionLog.redactionLogEntry?.forEach(redactionLogEntry => {
|
||||
// false positive entries from the redaction-log need to be skipped
|
||||
if (redactionLogEntry.type?.toLowerCase() === 'false_positive') {
|
||||
return;
|
||||
}
|
||||
|
||||
const existingChangeLogEntry = this.redactionChangeLog?.redactionLogEntry?.find(
|
||||
(rle) => rle.id === redactionLogEntry.id
|
||||
rle => rle.id === redactionLogEntry.id
|
||||
);
|
||||
|
||||
// copy the redactionLog Entry
|
||||
@ -114,8 +114,8 @@ export class FileDataModel {
|
||||
result.push(redactionLogEntryWrapper);
|
||||
});
|
||||
|
||||
this.manualRedactions.forceRedactions?.forEach((forceRedaction) => {
|
||||
const relevantRedactionLogEntry = result.find((r) => r.id === forceRedaction.id);
|
||||
this.manualRedactions.forceRedactions?.forEach(forceRedaction => {
|
||||
const relevantRedactionLogEntry = result.find(r => r.id === forceRedaction.id);
|
||||
|
||||
if (forceRedaction.status === 'DECLINED') {
|
||||
relevantRedactionLogEntry.status = 'DECLINED';
|
||||
@ -142,10 +142,10 @@ export class FileDataModel {
|
||||
}
|
||||
});
|
||||
|
||||
this.manualRedactions.entriesToAdd?.forEach((manual) => {
|
||||
const markedAsReasonRedactionLogEntry = result.find((r) => r.id === manual.reason);
|
||||
this.manualRedactions.entriesToAdd?.forEach(manual => {
|
||||
const markedAsReasonRedactionLogEntry = result.find(r => r.id === manual.reason);
|
||||
|
||||
const relevantRedactionLogEntry = result.find((r) => r.id === manual.id);
|
||||
const relevantRedactionLogEntry = result.find(r => r.id === manual.id);
|
||||
|
||||
// a redaction-log entry is marked as a reason for another entry - hide it
|
||||
if (markedAsReasonRedactionLogEntry) {
|
||||
@ -206,8 +206,8 @@ export class FileDataModel {
|
||||
}
|
||||
});
|
||||
|
||||
this.manualRedactions.idsToRemove?.forEach((idToRemove) => {
|
||||
const relevantRedactionLogEntry = result.find((r) => r.id === idToRemove.id);
|
||||
this.manualRedactions.idsToRemove?.forEach(idToRemove => {
|
||||
const relevantRedactionLogEntry = result.find(r => r.id === idToRemove.id);
|
||||
|
||||
if (!relevantRedactionLogEntry) {
|
||||
// idRemove for something that doesn't exist - skip
|
||||
@ -230,11 +230,11 @@ export class FileDataModel {
|
||||
}
|
||||
});
|
||||
|
||||
result.forEach((redactionLogEntry) => {
|
||||
result.forEach(redactionLogEntry => {
|
||||
if (redactionLogEntry.manual) {
|
||||
if (redactionLogEntry.manualRedactionType === 'ADD') {
|
||||
const foundManualEntry = this.manualRedactions.entriesToAdd.find(
|
||||
(me) => me.id === redactionLogEntry.id
|
||||
me => me.id === redactionLogEntry.id
|
||||
);
|
||||
// ADD has been undone - not yet processed
|
||||
if (!foundManualEntry) {
|
||||
@ -243,7 +243,7 @@ export class FileDataModel {
|
||||
}
|
||||
if (redactionLogEntry.manualRedactionType === 'REMOVE') {
|
||||
const foundManualEntry = this.manualRedactions.idsToRemove.find(
|
||||
(me) => me.id === redactionLogEntry.id
|
||||
me => me.id === redactionLogEntry.id
|
||||
);
|
||||
// REMOVE has been undone - not yet processed
|
||||
if (!foundManualEntry) {
|
||||
@ -256,7 +256,7 @@ export class FileDataModel {
|
||||
});
|
||||
|
||||
// remove undone entriesToAdd and idsToRemove
|
||||
result = result.filter((redactionLogEntry) => !redactionLogEntry.hidden);
|
||||
result = result.filter(redactionLogEntry => !redactionLogEntry.hidden);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export class FileStatusWrapper {
|
||||
|
||||
if (fileAttributesConfig) {
|
||||
const primary = fileAttributesConfig.fileAttributeConfigs?.find(
|
||||
(c) => c.primaryAttribute
|
||||
c => c.primaryAttribute
|
||||
);
|
||||
if (primary && fileStatus.fileAttributes?.attributeIdToValue) {
|
||||
this.primaryAttribute = fileStatus.fileAttributes?.attributeIdToValue[primary.id];
|
||||
|
||||
@ -179,7 +179,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
name: this.yAxisLabel,
|
||||
series: this.results
|
||||
});
|
||||
return this.combinedSeries.map((d) => d.name);
|
||||
return this.combinedSeries.map(d => d.name);
|
||||
}
|
||||
|
||||
isDate(value): boolean {
|
||||
@ -228,7 +228,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
const max = Math.max(...values);
|
||||
domain = [min, max];
|
||||
} else if (this.scaleType === 'linear') {
|
||||
values = values.map((v) => Number(v));
|
||||
values = values.map(v => Number(v));
|
||||
const min = Math.min(...values);
|
||||
const max = Math.max(...values);
|
||||
domain = [min, max];
|
||||
@ -317,11 +317,11 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
}
|
||||
|
||||
getXDomain(): any[] {
|
||||
return this.results.map((d) => d.name);
|
||||
return this.results.map(d => d.name);
|
||||
}
|
||||
|
||||
getYDomain() {
|
||||
const values = this.results.map((d) => d.value);
|
||||
const values = this.results.map(d => d.value);
|
||||
const min = Math.min(0, ...values);
|
||||
const max = Math.max(...values);
|
||||
if (this.yLeftAxisScaleFactor) {
|
||||
@ -388,7 +388,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
|
||||
onActivate(item) {
|
||||
const idx = this.activeEntries.findIndex(
|
||||
(d) => d.name === item.name && d.value === item.value && d.series === item.series
|
||||
d => d.name === item.name && d.value === item.value && d.series === item.series
|
||||
);
|
||||
if (idx > -1) {
|
||||
return;
|
||||
@ -400,7 +400,7 @@ export class ComboChartComponent extends BaseChartComponent {
|
||||
|
||||
onDeactivate(item) {
|
||||
const idx = this.activeEntries.findIndex(
|
||||
(d) => d.name === item.name && d.value === item.value && d.series === item.series
|
||||
d => d.name === item.name && d.value === item.value && d.series === item.series
|
||||
);
|
||||
|
||||
this.activeEntries.splice(idx, 1);
|
||||
|
||||
@ -89,7 +89,7 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
let d0 = 0;
|
||||
let total;
|
||||
if (this.type === 'normalized') {
|
||||
total = this.series.map((d) => d.value).reduce((sum, d) => sum + d, 0);
|
||||
total = this.series.map(d => d.value).reduce((sum, d) => sum + d, 0);
|
||||
}
|
||||
|
||||
this.bars = this.series.map((d, index) => {
|
||||
@ -184,13 +184,13 @@ export class ComboSeriesVerticalComponent implements OnChanges {
|
||||
}
|
||||
|
||||
getSeriesTooltips(seriesLine, index) {
|
||||
return seriesLine.map((d) => d.series[index]);
|
||||
return seriesLine.map(d => d.series[index]);
|
||||
}
|
||||
|
||||
isActive(entry): boolean {
|
||||
if (!this.activeEntries) return false;
|
||||
const item = this.activeEntries.find(
|
||||
(d) => entry.name === d.name && entry.series === d.series
|
||||
d => entry.name === d.name && entry.series === d.series
|
||||
);
|
||||
return item !== undefined;
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ export class DossierTemplateActionsComponent {
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openAddEditDossierTemplateDialog(
|
||||
this.dossierTemplate,
|
||||
async (newDossierTemplate) => {
|
||||
async newDossierTemplate => {
|
||||
if (newDossierTemplate && this.loadDossierTemplatesData) {
|
||||
this.loadDossierTemplatesData.emit();
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export class AddEditDictionaryDialogComponent {
|
||||
() => {
|
||||
this.dialogRef.close({ dictionary: this.dictionary ? null : typeValue });
|
||||
},
|
||||
(error) => {
|
||||
error => {
|
||||
if (error.status === 409) {
|
||||
this._notifyError('add-edit-dictionary.error.dictionary-already-exists');
|
||||
} else if (error.status === 400) {
|
||||
|
||||
@ -62,7 +62,7 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
this._previousValidFrom = this.dossierTemplateForm.get('validFrom').value;
|
||||
this._previousValidTo = this.dossierTemplateForm.get('validTo').value;
|
||||
|
||||
this.dossierTemplateForm.valueChanges.subscribe((value) => {
|
||||
this.dossierTemplateForm.valueChanges.subscribe(value => {
|
||||
this._applyValidityIntervalConstraints(value);
|
||||
});
|
||||
}
|
||||
@ -138,7 +138,7 @@ export class AddEditDossierTemplateDialogComponent {
|
||||
}
|
||||
|
||||
private _requiredIfValidator(predicate) {
|
||||
return (formControl) => {
|
||||
return formControl => {
|
||||
if (!formControl.parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ export class AddEditUserDialogComponent {
|
||||
|
||||
private _setRolesRequirements() {
|
||||
for (const key of Object.keys(this._ROLE_REQUIREMENTS)) {
|
||||
this.userForm.controls[key].valueChanges.subscribe((checked) => {
|
||||
this.userForm.controls[key].valueChanges.subscribe(checked => {
|
||||
if (checked) {
|
||||
this.userForm.patchValue({ [this._ROLE_REQUIREMENTS[key]]: true });
|
||||
this.userForm.controls[this._ROLE_REQUIREMENTS[key]].disable();
|
||||
|
||||
@ -21,7 +21,7 @@ export class ConfirmDeleteUsersDialogComponent {
|
||||
private readonly _appStateService: AppStateService,
|
||||
public dialogRef: MatDialogRef<ConfirmDeleteUsersDialogComponent>
|
||||
) {
|
||||
this.dossiersCount = this._appStateService.allDossiers.filter((pw) => {
|
||||
this.dossiersCount = this._appStateService.allDossiers.filter(pw => {
|
||||
for (const user of this.users) {
|
||||
if (pw.memberIds.indexOf(user.userId) !== -1) {
|
||||
return true;
|
||||
|
||||
@ -43,16 +43,16 @@ export class ActiveFieldsListingComponent extends BaseListingComponent<Field> im
|
||||
|
||||
deactivateSelection() {
|
||||
this.allEntities
|
||||
.filter((field) => this.isEntitySelected(field))
|
||||
.forEach((field) => (field.primaryAttribute = false));
|
||||
this.allEntities = [...this.allEntities.filter((field) => !this.isEntitySelected(field))];
|
||||
.filter(field => this.isEntitySelected(field))
|
||||
.forEach(field => (field.primaryAttribute = false));
|
||||
this.allEntities = [...this.allEntities.filter(field => !this.isEntitySelected(field))];
|
||||
this.allEntitiesChange.emit(this.allEntities);
|
||||
this.selectedEntitiesIds = [];
|
||||
}
|
||||
|
||||
setAttributeForSelection(attribute: string, value: any) {
|
||||
for (const csvColumn of this.selectedEntitiesIds) {
|
||||
this.allEntities.find((f) => f.csvColumn === csvColumn)[attribute] = value;
|
||||
this.allEntities.find(f => f.csvColumn === csvColumn)[attribute] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
|
||||
readFile() {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener('load', async (event) => {
|
||||
reader.addEventListener('load', async event => {
|
||||
const parsedCsv = <any>event.target.result;
|
||||
this.parseResult = Papa.parse(parsedCsv, {
|
||||
header: true,
|
||||
@ -100,7 +100,7 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
this.parseResult.meta.fields = Object.keys(this.parseResult.data[0]);
|
||||
}
|
||||
|
||||
this.allEntities = this.parseResult.meta.fields.map((field) =>
|
||||
this.allEntities = this.parseResult.meta.fields.map(field =>
|
||||
this._buildAttribute(field)
|
||||
);
|
||||
this.displayedEntities = [...this.allEntities];
|
||||
@ -108,7 +108,7 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
|
||||
for (const entity of this.allEntities) {
|
||||
const existing = this.data.existingConfiguration.fileAttributeConfigs.find(
|
||||
(a) => a.csvColumnHeader === entity.csvColumn
|
||||
a => a.csvColumnHeader === entity.csvColumn
|
||||
);
|
||||
if (existing) {
|
||||
entity.id = existing.id;
|
||||
@ -130,18 +130,18 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
map((value: string) =>
|
||||
this.allEntities
|
||||
.filter(
|
||||
(field) =>
|
||||
field =>
|
||||
field.csvColumn.toLowerCase().indexOf(value.toLowerCase()) !==
|
||||
-1
|
||||
)
|
||||
.map((field) => field.csvColumn)
|
||||
.map(field => field.csvColumn)
|
||||
)
|
||||
);
|
||||
|
||||
if (
|
||||
this.data.existingConfiguration &&
|
||||
this.allEntities.find(
|
||||
(entity) =>
|
||||
entity =>
|
||||
entity.csvColumn ===
|
||||
this.data.existingConfiguration.filenameMappingColumnHeaderName
|
||||
)
|
||||
@ -200,11 +200,11 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
}
|
||||
|
||||
async save() {
|
||||
const newPrimary = !!this.activeFields.find((attr) => attr.primaryAttribute);
|
||||
const newPrimary = !!this.activeFields.find(attr => attr.primaryAttribute);
|
||||
|
||||
if (newPrimary) {
|
||||
this.data.existingConfiguration.fileAttributeConfigs.forEach(
|
||||
(attr) => (attr.primaryAttribute = false)
|
||||
attr => (attr.primaryAttribute = false)
|
||||
);
|
||||
}
|
||||
|
||||
@ -212,10 +212,9 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
...this.baseConfigForm.getRawValue(),
|
||||
fileAttributeConfigs: [
|
||||
...this.data.existingConfiguration.fileAttributeConfigs.filter(
|
||||
(a) =>
|
||||
!this.allEntities.find((entity) => entity.csvColumn === a.csvColumnHeader)
|
||||
a => !this.allEntities.find(entity => entity.csvColumn === a.csvColumnHeader)
|
||||
),
|
||||
...this.activeFields.map((field) => ({
|
||||
...this.activeFields.map(field => ({
|
||||
id: field.id,
|
||||
csvColumnHeader: field.csvColumn,
|
||||
editable: !field.readonly,
|
||||
@ -259,8 +258,8 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent
|
||||
this.columnSample = [];
|
||||
} else {
|
||||
this.columnSample = this.parseResult.data
|
||||
.filter((row) => !!row[column])
|
||||
.map((row) => row[column]);
|
||||
.filter(row => !!row[column])
|
||||
.map(row => row[column]);
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ export class AuditScreenComponent {
|
||||
to: []
|
||||
});
|
||||
|
||||
this.filterForm.valueChanges.subscribe((value) => {
|
||||
this.filterForm.valueChanges.subscribe(value => {
|
||||
if (!this._updateDateFilters(value)) {
|
||||
this._fetchData();
|
||||
}
|
||||
@ -102,12 +102,12 @@ export class AuditScreenComponent {
|
||||
promises.push(this._auditControllerService.getAuditCategories().toPromise());
|
||||
promises.push(this._auditControllerService.searchAuditLog(logsRequestBody).toPromise());
|
||||
|
||||
Promise.all(promises).then((data) => {
|
||||
this.categories = data[0].map((c) => c.category);
|
||||
Promise.all(promises).then(data => {
|
||||
this.categories = data[0].map(c => c.category);
|
||||
this.categories.splice(0, 0, this.ALL_CATEGORIES);
|
||||
this.logs = data[1];
|
||||
this.userIds = new Set<string>([this.ALL_USERS]);
|
||||
for (const id of this.logs.data.map((log) => log.userId).filter((uid) => !!uid)) {
|
||||
for (const id of this.logs.data.map(log => log.userId).filter(uid => !!uid)) {
|
||||
this.userIds.add(id);
|
||||
}
|
||||
this.viewReady = true;
|
||||
|
||||
@ -54,9 +54,9 @@ export class DefaultColorsScreenComponent extends BaseListingComponent<{
|
||||
this._dictionaryControllerService
|
||||
.getColors(this._appStateService.activeDossierTemplateId)
|
||||
.toPromise()
|
||||
.then((data) => {
|
||||
.then(data => {
|
||||
this._colorsObj = data;
|
||||
this.allEntities = Object.keys(data).map((key) => ({
|
||||
this.allEntities = Object.keys(data).map(key => ({
|
||||
key,
|
||||
value: data[key]
|
||||
}));
|
||||
|
||||
@ -48,7 +48,7 @@ export class DictionaryListingScreenComponent
|
||||
this._dialogService.openAddEditDictionaryDialog(
|
||||
dict,
|
||||
this._appStateService.activeDossierTemplateId,
|
||||
async (newDictionary) => {
|
||||
async newDictionary => {
|
||||
if (newDictionary) {
|
||||
await this._appStateService.loadDictionaryData();
|
||||
this._loadDictionaryData();
|
||||
@ -73,14 +73,14 @@ export class DictionaryListingScreenComponent
|
||||
const appStateDictionaryData =
|
||||
this._appStateService.dictionaryData[this._appStateService.activeDossierTemplateId];
|
||||
this.allEntities = Object.keys(appStateDictionaryData)
|
||||
.map((key) => appStateDictionaryData[key])
|
||||
.filter((d) => !d.virtual);
|
||||
.map(key => appStateDictionaryData[key])
|
||||
.filter(d => !d.virtual);
|
||||
this.displayedEntities = [...this.allEntities];
|
||||
const dataObs = this.allEntities.map((dict) =>
|
||||
const dataObs = this.allEntities.map(dict =>
|
||||
this._dictionaryControllerService
|
||||
.getDictionaryForType(this._appStateService.activeDossierTemplateId, dict.type)
|
||||
.pipe(
|
||||
tap((values) => {
|
||||
tap(values => {
|
||||
dict.entries = values.entries ? values.entries : [];
|
||||
}),
|
||||
catchError(() => {
|
||||
|
||||
@ -63,10 +63,10 @@
|
||||
<redaction-admin-side-nav type="dossier-templates"></redaction-admin-side-nav>
|
||||
|
||||
<redaction-dictionary-manager
|
||||
[initialEntries]="entries"
|
||||
[canEdit]="permissionsService.isAdmin()"
|
||||
(saveDictionary)="saveEntries($event)"
|
||||
#dictionaryManager
|
||||
(saveDictionary)="saveEntries($event)"
|
||||
[canEdit]="permissionsService.isAdmin()"
|
||||
[initialEntries]="entries"
|
||||
></redaction-dictionary-manager>
|
||||
|
||||
<div class="right-container">
|
||||
|
||||
@ -41,10 +41,6 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._loadEntries();
|
||||
}
|
||||
|
||||
get dictionary(): TypeValueWrapper {
|
||||
return this._appStateService.activeDictionary;
|
||||
}
|
||||
@ -53,6 +49,10 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
return this._dictionaryManager.hasChanges;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._loadEntries();
|
||||
}
|
||||
|
||||
openEditDictionaryDialog($event: any) {
|
||||
$event.stopPropagation();
|
||||
this._dialogService.openAddEditDictionaryDialog(
|
||||
@ -123,7 +123,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
this._dictionaryControllerService
|
||||
.getDictionaryForType(this.dictionary.dossierTemplateId, this.dictionary.type)
|
||||
.subscribe(
|
||||
(data) => {
|
||||
data => {
|
||||
this.processing = false;
|
||||
this.entries = data.entries.sort((str1, str2) =>
|
||||
str1.localeCompare(str2, undefined, { sensitivity: 'accent' })
|
||||
|
||||
@ -55,7 +55,7 @@ export class DigitalSignatureScreenComponent {
|
||||
NotificationType.SUCCESS
|
||||
);
|
||||
},
|
||||
(error) => {
|
||||
error => {
|
||||
if (error.status === 400) {
|
||||
this._notificationService.showToastNotification(
|
||||
this._translateService.instant(
|
||||
@ -117,7 +117,7 @@ export class DigitalSignatureScreenComponent {
|
||||
this._digitalSignatureControllerService
|
||||
.getDigitalSignature()
|
||||
.subscribe(
|
||||
(digitalSignature) => {
|
||||
digitalSignature => {
|
||||
this.digitalSignatureExists = true;
|
||||
this.digitalSignature = digitalSignature;
|
||||
},
|
||||
|
||||
@ -41,7 +41,7 @@ export class DossierTemplatesListingScreenComponent
|
||||
}
|
||||
|
||||
openAddDossierTemplateDialog() {
|
||||
this._dialogService.openAddEditDossierTemplateDialog(null, async (newDossierTemplate) => {
|
||||
this._dialogService.openAddEditDossierTemplateDialog(null, async newDossierTemplate => {
|
||||
if (newDossierTemplate) {
|
||||
this.loadDossierTemplatesData();
|
||||
}
|
||||
@ -49,12 +49,12 @@ export class DossierTemplatesListingScreenComponent
|
||||
}
|
||||
|
||||
private _loadDossierTemplateStats() {
|
||||
this.allEntities.forEach((rs) => {
|
||||
this.allEntities.forEach(rs => {
|
||||
const dictionaries = this._appStateService.dictionaryData[rs.dossierTemplateId];
|
||||
if (dictionaries) {
|
||||
rs.dictionariesCount = Object.keys(dictionaries)
|
||||
.map((key) => dictionaries[key])
|
||||
.filter((d) => !d.virtual || d.type === 'false_positive').length;
|
||||
.map(key => dictionaries[key])
|
||||
.filter(d => !d.virtual || d.type === 'false_positive').length;
|
||||
} else {
|
||||
rs.dictionariesCount = 0;
|
||||
rs.totalDictionaryEntries = 0;
|
||||
|
||||
@ -68,7 +68,7 @@ export class LicenseInformationScreenComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
Promise.all(promises).then((reports) => {
|
||||
Promise.all(promises).then(reports => {
|
||||
[this.currentInfo, this.totalInfo, this.unlicensedInfo] = reports;
|
||||
this.viewReady = true;
|
||||
this.analysisPercentageOfLicense =
|
||||
|
||||
@ -21,9 +21,9 @@
|
||||
|
||||
<div class="editor-container">
|
||||
<ngx-monaco-editor
|
||||
[options]="editorOptions"
|
||||
[(ngModel)]="codeEditorText"
|
||||
(init)="onCodeEditorInit($event)"
|
||||
[(ngModel)]="codeEditorText"
|
||||
[options]="editorOptions"
|
||||
></ngx-monaco-editor>
|
||||
</div>
|
||||
<div *ngIf="hasChanges && permissionsService.isAdmin()" class="changes-box">
|
||||
|
||||
@ -50,19 +50,6 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
this._initialize();
|
||||
}
|
||||
|
||||
onCodeEditorInit(editor: ICodeEditor) {
|
||||
this._codeEditor = editor;
|
||||
(window as any).monaco.editor.defineTheme('redaction', {
|
||||
base: 'vs',
|
||||
inherit: true,
|
||||
rules: [],
|
||||
colors: {
|
||||
'editor.lineHighlightBackground': '#f4f5f7'
|
||||
}
|
||||
});
|
||||
(window as any).monaco.editor.setTheme('redaction');
|
||||
}
|
||||
|
||||
get hasChanges(): boolean {
|
||||
return this.currentLines.toString() !== this.initialLines.toString();
|
||||
}
|
||||
@ -76,28 +63,28 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
this.codeEditorTextChanged();
|
||||
}
|
||||
|
||||
onCodeEditorInit(editor: ICodeEditor) {
|
||||
this._codeEditor = editor;
|
||||
(window as any).monaco.editor.defineTheme('redaction', {
|
||||
base: 'vs',
|
||||
inherit: true,
|
||||
rules: [],
|
||||
colors: {
|
||||
'editor.lineHighlightBackground': '#f4f5f7'
|
||||
}
|
||||
});
|
||||
(window as any).monaco.editor.setTheme('redaction');
|
||||
}
|
||||
|
||||
@debounce()
|
||||
codeEditorTextChanged() {
|
||||
const newDecorations = this.currentLines
|
||||
.filter((entry) => this._isNew(entry))
|
||||
.map((entry) => this._makeDecorationFor(entry));
|
||||
.filter(entry => this._isNew(entry))
|
||||
.map(entry => this._makeDecorationFor(entry));
|
||||
|
||||
this._decorations = this._codeEditor.deltaDecorations(this._decorations, newDecorations);
|
||||
}
|
||||
|
||||
private _isNew(entry: string): boolean {
|
||||
return this.initialLines.indexOf(entry) < 0 && entry?.trim().length > 0;
|
||||
}
|
||||
|
||||
private _makeDecorationFor(entry: string): IModelDeltaDecoration {
|
||||
const line = this.currentLines.indexOf(entry) + 1;
|
||||
|
||||
return {
|
||||
range: new monaco.Range(line, 1, line, 1),
|
||||
options: { isWholeLine: true, className: 'changed-row-marker' }
|
||||
} as IModelDeltaDecoration;
|
||||
}
|
||||
|
||||
async save(): Promise<void> {
|
||||
this.processing = true;
|
||||
this._rulesControllerService
|
||||
@ -152,11 +139,24 @@ export class RulesScreenComponent extends ComponentHasChanges {
|
||||
}
|
||||
}
|
||||
|
||||
private _isNew(entry: string): boolean {
|
||||
return this.initialLines.indexOf(entry) < 0 && entry?.trim().length > 0;
|
||||
}
|
||||
|
||||
private _makeDecorationFor(entry: string): IModelDeltaDecoration {
|
||||
const line = this.currentLines.indexOf(entry) + 1;
|
||||
|
||||
return {
|
||||
range: new monaco.Range(line, 1, line, 1),
|
||||
options: { isWholeLine: true, className: 'changed-row-marker' }
|
||||
} as IModelDeltaDecoration;
|
||||
}
|
||||
|
||||
private _initialize() {
|
||||
this._rulesControllerService
|
||||
.downloadRules(this._appStateService.activeDossierTemplateId)
|
||||
.subscribe(
|
||||
(rules) => {
|
||||
rules => {
|
||||
this.currentLines = this.initialLines = rules.rules.split('\n');
|
||||
this.revert();
|
||||
},
|
||||
|
||||
@ -40,7 +40,7 @@ export class SmtpConfigScreenComponent implements OnInit {
|
||||
password: [undefined]
|
||||
});
|
||||
|
||||
this.configForm.controls.auth.valueChanges.subscribe((auth) => {
|
||||
this.configForm.controls.auth.valueChanges.subscribe(auth => {
|
||||
if (auth) {
|
||||
this.openAuthConfigDialog();
|
||||
}
|
||||
@ -73,16 +73,13 @@ export class SmtpConfigScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
openAuthConfigDialog(skipDisableOnCancel?: boolean) {
|
||||
this._dialogService.openSMTPAuthConfigDialog(
|
||||
this.configForm.getRawValue(),
|
||||
(authConfig) => {
|
||||
if (authConfig) {
|
||||
this.configForm.patchValue(authConfig);
|
||||
} else if (!skipDisableOnCancel) {
|
||||
this.configForm.patchValue({ auth: false }, { emitEvent: false });
|
||||
}
|
||||
this._dialogService.openSMTPAuthConfigDialog(this.configForm.getRawValue(), authConfig => {
|
||||
if (authConfig) {
|
||||
this.configForm.patchValue(authConfig);
|
||||
} else if (!skipDisableOnCancel) {
|
||||
this.configForm.patchValue({ auth: false }, { emitEvent: false });
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async testConnection() {
|
||||
|
||||
@ -42,7 +42,7 @@ export class UserListingScreenComponent extends BaseListingComponent<User> imple
|
||||
|
||||
openAddEditUserDialog($event: MouseEvent, user?: User) {
|
||||
$event.stopPropagation();
|
||||
this._adminDialogService.openAddEditUserDialog(user, async (result) => {
|
||||
this._adminDialogService.openAddEditUserDialog(user, async result => {
|
||||
if (result === 'DELETE') {
|
||||
this.openDeleteUserDialog([user]);
|
||||
} else {
|
||||
@ -63,14 +63,14 @@ export class UserListingScreenComponent extends BaseListingComponent<User> imple
|
||||
$event?.stopPropagation();
|
||||
this._adminDialogService.openConfirmDeleteUsersDialog(users, async () => {
|
||||
this.loading = true;
|
||||
await this._userControllerService.deleteUsers(users.map((u) => u.userId)).toPromise();
|
||||
await this._userControllerService.deleteUsers(users.map(u => u.userId)).toPromise();
|
||||
await this._loadData();
|
||||
});
|
||||
}
|
||||
|
||||
getDisplayRoles(user: User) {
|
||||
return (
|
||||
user.roles.map((role) => this._translateService.instant('roles.' + role)).join(', ') ||
|
||||
user.roles.map(role => this._translateService.instant('roles.' + role)).join(', ') ||
|
||||
this._translateService.instant('roles.NO_ROLE')
|
||||
);
|
||||
}
|
||||
@ -87,7 +87,7 @@ export class UserListingScreenComponent extends BaseListingComponent<User> imple
|
||||
}
|
||||
|
||||
async bulkDelete() {
|
||||
this.openDeleteUserDialog(this.allEntities.filter((u) => this.isEntitySelected(u)));
|
||||
this.openDeleteUserDialog(this.allEntities.filter(u => this.isEntitySelected(u)));
|
||||
}
|
||||
|
||||
protected _searchField(user: any): string {
|
||||
@ -106,36 +106,34 @@ export class UserListingScreenComponent extends BaseListingComponent<User> imple
|
||||
this.chartData = this._translateChartService.translateRoles(
|
||||
[
|
||||
{
|
||||
value: this.allEntities.filter((user) => !this.userService.isActive(user))
|
||||
.length,
|
||||
value: this.allEntities.filter(user => !this.userService.isActive(user)).length,
|
||||
color: 'INACTIVE',
|
||||
label: 'INACTIVE'
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(
|
||||
(user) => user.roles.length === 1 && user.roles[0] === 'RED_USER'
|
||||
user => user.roles.length === 1 && user.roles[0] === 'RED_USER'
|
||||
).length,
|
||||
color: 'REGULAR',
|
||||
label: 'REGULAR'
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(
|
||||
(user) =>
|
||||
this.userService.isManager(user) && !this.userService.isAdmin(user)
|
||||
user => this.userService.isManager(user) && !this.userService.isAdmin(user)
|
||||
).length,
|
||||
color: 'MANAGER',
|
||||
label: 'RED_MANAGER'
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(
|
||||
(user) => this.userService.isManager(user) && this.userService.isAdmin(user)
|
||||
user => this.userService.isManager(user) && this.userService.isAdmin(user)
|
||||
).length,
|
||||
color: 'MANAGER_ADMIN',
|
||||
label: 'MANAGER_ADMIN'
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(
|
||||
(user) =>
|
||||
user =>
|
||||
this.userService.isUserAdmin(user) && !this.userService.isAdmin(user)
|
||||
).length,
|
||||
color: 'USER_ADMIN',
|
||||
@ -143,13 +141,12 @@ export class UserListingScreenComponent extends BaseListingComponent<User> imple
|
||||
},
|
||||
{
|
||||
value: this.allEntities.filter(
|
||||
(user) =>
|
||||
this.userService.isAdmin(user) && !this.userService.isManager(user)
|
||||
user => this.userService.isAdmin(user) && !this.userService.isManager(user)
|
||||
).length,
|
||||
color: 'ADMIN',
|
||||
label: 'RED_ADMIN'
|
||||
}
|
||||
].filter((type) => type.value > 0)
|
||||
].filter(type => type.value > 0)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
this._watermarkControllerService
|
||||
.getWatermark(this.appStateService.activeDossierTemplateId)
|
||||
.subscribe(
|
||||
(watermark) => {
|
||||
watermark => {
|
||||
this._watermark = watermark;
|
||||
this.configForm.setValue({ ...this._watermark });
|
||||
this._loadViewer();
|
||||
@ -153,7 +153,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
isReadOnly: true
|
||||
},
|
||||
this._viewer.nativeElement
|
||||
).then((instance) => {
|
||||
).then(instance => {
|
||||
this._instance = instance;
|
||||
|
||||
instance.docViewer.on('documentLoaded', () => {
|
||||
@ -167,7 +167,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
.request('get', '/assets/pdftron/blank.pdf', {
|
||||
responseType: 'blob'
|
||||
})
|
||||
.subscribe((blobData) => {
|
||||
.subscribe(blobData => {
|
||||
console.log('load blank');
|
||||
this._instance.loadDocument(blobData, { filename: 'blank.pdf' });
|
||||
});
|
||||
|
||||
@ -61,7 +61,7 @@ export class AdminDialogService {
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result) {
|
||||
await this._dictionaryControllerService
|
||||
.deleteType(dictionary.type, dossierTemplateId)
|
||||
@ -79,7 +79,7 @@ export class AdminDialogService {
|
||||
): MatDialogRef<ConfirmationDialogComponent> {
|
||||
$event.stopPropagation();
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result) {
|
||||
await this._dossierTemplateControllerService
|
||||
.getAllDossierTemplates(dossierTemplate.dossierTemplateId)
|
||||
@ -101,7 +101,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -122,7 +122,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -142,7 +142,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -162,7 +162,7 @@ export class AdminDialogService {
|
||||
data: { csv, dossierTemplateId, existingConfiguration }
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -182,7 +182,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -202,7 +202,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -221,7 +221,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -237,7 +237,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -256,7 +256,7 @@ export class AdminDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
|
||||
@ -42,10 +42,14 @@ export class AppConfigService {
|
||||
private readonly _titleService: Title
|
||||
) {}
|
||||
|
||||
get version(): string {
|
||||
return packageInfo.version;
|
||||
}
|
||||
|
||||
loadAppConfig(): Observable<any> {
|
||||
this._cacheApiService
|
||||
.getCachedValue(AppConfigKey.FRONTEND_APP_VERSION)
|
||||
.then(async (lastVersion) => {
|
||||
.then(async lastVersion => {
|
||||
console.log(
|
||||
'[REDACTION] Last app version: ',
|
||||
lastVersion,
|
||||
@ -63,7 +67,7 @@ export class AppConfigService {
|
||||
});
|
||||
|
||||
return this._httpClient.get<any>('/assets/config/config.json').pipe(
|
||||
tap((config) => {
|
||||
tap(config => {
|
||||
console.log('[REDACTION] Started with config: ', config);
|
||||
this._config = config;
|
||||
this._config[AppConfigKey.FRONTEND_APP_VERSION] = this.version;
|
||||
@ -75,8 +79,4 @@ export class AppConfigService {
|
||||
getConfig(key: AppConfigKey | string, defaultValue?: any) {
|
||||
return this._config[key] ? this._config[key] : defaultValue;
|
||||
}
|
||||
|
||||
get version(): string {
|
||||
return packageInfo.version;
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ export class RedRoleGuard implements CanActivate {
|
||||
) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
|
||||
return new Observable((obs) => {
|
||||
return new Observable(obs => {
|
||||
if (!this._userService.user.hasAnyREDRoles) {
|
||||
this._router.navigate(['/auth-error']);
|
||||
this._appLoadStateService.pushLoadingEvent(false);
|
||||
|
||||
@ -41,7 +41,7 @@ export class AnnotationRemoveActionsComponent {
|
||||
|
||||
@Input()
|
||||
set annotations(value: AnnotationWrapper[]) {
|
||||
this._annotations = value.filter((a) => a !== undefined);
|
||||
this._annotations = value.filter(a => a !== undefined);
|
||||
this._setPermissions();
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
<redaction-circle-button
|
||||
(action)="assign()"
|
||||
*ngIf="canAssign"
|
||||
icon="red:assign"
|
||||
[tooltip]="assignTooltip"
|
||||
icon="red:assign"
|
||||
type="dark-bg"
|
||||
></redaction-circle-button>
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="selectedFiles"
|
||||
[dossier]="dossier"
|
||||
[file]="selectedFiles"
|
||||
></redaction-file-download-btn>
|
||||
|
||||
<!-- Approved-->
|
||||
|
||||
@ -42,7 +42,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
}
|
||||
|
||||
get selectedFiles(): FileStatusWrapper[] {
|
||||
return this.selectedFileIds.map((fileId) =>
|
||||
return this.selectedFileIds.map(fileId =>
|
||||
this._appStateService.getFileById(
|
||||
this._appStateService.activeDossier.dossier.dossierId,
|
||||
fileId
|
||||
@ -119,7 +119,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
}
|
||||
|
||||
get fileStatuses() {
|
||||
return this.selectedFiles.map((file) => file.fileStatus.status);
|
||||
return this.selectedFiles.map(file => file.fileStatus.status);
|
||||
}
|
||||
|
||||
// Under review
|
||||
@ -189,7 +189,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
// If more than 1 approver - show dialog and ask who to assign
|
||||
if (this._appStateService.activeDossier.approverIds.length > 1) {
|
||||
this.loading = true;
|
||||
const files = this.selectedFileIds.map((fileId) =>
|
||||
const files = this.selectedFileIds.map(fileId =>
|
||||
this._appStateService.getFileById(this._appStateService.activeDossierId, fileId)
|
||||
);
|
||||
|
||||
@ -214,8 +214,8 @@ export class DossierOverviewBulkActionsComponent {
|
||||
|
||||
async reanalyse() {
|
||||
const fileIds = this.selectedFiles
|
||||
.filter((file) => this._permissionsService.fileRequiresReanalysis(file))
|
||||
.map((file) => file.fileId);
|
||||
.filter(file => this._permissionsService.fileRequiresReanalysis(file))
|
||||
.map(file => file.fileId);
|
||||
this._performBulkAction(
|
||||
this._reanalysisControllerService.reanalyzeFilesForDossier(
|
||||
fileIds,
|
||||
@ -240,17 +240,9 @@ export class DossierOverviewBulkActionsComponent {
|
||||
this._performBulkAction(from(this._fileActionService.assignToMe(this.selectedFiles)));
|
||||
}
|
||||
|
||||
private _performBulkAction(obs: Observable<any>) {
|
||||
this.loading = true;
|
||||
obs.subscribe().add(() => {
|
||||
this.reload.emit();
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
assign() {
|
||||
this.loading = true;
|
||||
const files = this.selectedFileIds.map((fileId) =>
|
||||
const files = this.selectedFileIds.map(fileId =>
|
||||
this._appStateService.getFileById(this._appStateService.activeDossierId, fileId)
|
||||
);
|
||||
|
||||
@ -261,4 +253,12 @@ export class DossierOverviewBulkActionsComponent {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
private _performBulkAction(obs: Observable<any>) {
|
||||
this.loading = true;
|
||||
obs.subscribe().add(() => {
|
||||
this.reload.emit();
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ export class CommentsComponent {
|
||||
if (value) {
|
||||
this._manualAnnotationService
|
||||
.addComment(value, this.annotation.id)
|
||||
.subscribe((commentResponse) => {
|
||||
.subscribe(commentResponse => {
|
||||
this.annotation.comments.push({
|
||||
text: value,
|
||||
id: commentResponse.commentId,
|
||||
|
||||
@ -122,9 +122,9 @@
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
(click)="openDossierDictionaryDialog.emit()"
|
||||
*ngIf="appStateService.activeDossier.type"
|
||||
class="pointer"
|
||||
(click)="openDossierDictionaryDialog.emit()"
|
||||
>
|
||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.dictionary' | translate }} </span>
|
||||
|
||||
@ -67,7 +67,7 @@ export class DossierDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
toggleFilter(filterType: 'needsWorkFilters' | 'statusFilters', key: string): void {
|
||||
const filter = this.filters[filterType].find((f) => f.key === key);
|
||||
const filter = this.filters[filterType].find(f => f.key === key);
|
||||
filter.checked = !filter.checked;
|
||||
this.filtersChanged.emit(this.filters);
|
||||
}
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="dossier.files"
|
||||
[dossier]="dossier"
|
||||
[file]="dossier.files"
|
||||
type="dark-bg"
|
||||
></redaction-file-download-btn>
|
||||
</div>
|
||||
|
||||
@ -55,6 +55,6 @@ export class DossierListingActionsComponent {
|
||||
|
||||
return Object.keys(obj)
|
||||
.sort((a, b) => StatusSorter[a] - StatusSorter[b])
|
||||
.map((status) => ({ length: obj[status], color: status }));
|
||||
.map(status => ({ length: obj[status], color: status }));
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ export class DossierListingDetailsComponent {
|
||||
}
|
||||
|
||||
toggleFilter(filterType: 'needsWorkFilters' | 'statusFilters', key: string): void {
|
||||
const filter = this.filters[filterType].find((f) => f.key === key);
|
||||
const filter = this.filters[filterType].find(f => f.key === key);
|
||||
filter.checked = !filter.checked;
|
||||
this.filtersChanged.emit(this.filters);
|
||||
}
|
||||
|
||||
@ -31,26 +31,26 @@
|
||||
<redaction-circle-button
|
||||
(action)="assign($event)"
|
||||
*ngIf="canAssign && screen === 'dossier-overview'"
|
||||
icon="red:assign"
|
||||
[tooltip]="assignTooltip"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[tooltip]="assignTooltip"
|
||||
[type]="buttonType"
|
||||
icon="red:assign"
|
||||
></redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="assignToMe($event)"
|
||||
*ngIf="canAssignToSelf && screen === 'dossier-overview'"
|
||||
icon="red:assign-me"
|
||||
tooltip="dossier-overview.assign-me"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
icon="red:assign-me"
|
||||
tooltip="dossier-overview.assign-me"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<!-- download redacted file-->
|
||||
<redaction-file-download-btn
|
||||
[file]="fileStatus"
|
||||
[dossier]="appStateService.activeDossier"
|
||||
[file]="fileStatus"
|
||||
[tooltipClass]="'small'"
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[type]="buttonType"
|
||||
|
||||
@ -96,7 +96,7 @@ export class FileWorkloadComponent {
|
||||
}
|
||||
|
||||
annotationIsSelected(annotation: AnnotationWrapper) {
|
||||
return this.selectedAnnotations?.find((a) => a?.id === annotation.id);
|
||||
return this.selectedAnnotations?.find(a => a?.id === annotation.id);
|
||||
}
|
||||
|
||||
logAnnotation(annotation: AnnotationWrapper) {
|
||||
@ -105,7 +105,7 @@ export class FileWorkloadComponent {
|
||||
|
||||
pageHasSelection(page: number) {
|
||||
return (
|
||||
this.multiSelectActive && !!this.selectedAnnotations?.find((a) => a.pageNumber === page)
|
||||
this.multiSelectActive && !!this.selectedAnnotations?.find(a => a.pageNumber === page)
|
||||
);
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ export class FileWorkloadComponent {
|
||||
filters.primary,
|
||||
filters.secondary
|
||||
);
|
||||
this.displayedPages = Object.keys(this.displayedAnnotations).map((key) => Number(key));
|
||||
this.displayedPages = Object.keys(this.displayedAnnotations).map(key => Number(key));
|
||||
this._changeDetectorRef.markForCheck();
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ export class FileWorkloadComponent {
|
||||
}
|
||||
|
||||
scrollQuickNavigation() {
|
||||
let quickNavPageIndex = this.displayedPages.findIndex((p) => p >= this.activeViewerPage);
|
||||
let quickNavPageIndex = this.displayedPages.findIndex(p => p >= this.activeViewerPage);
|
||||
if (
|
||||
quickNavPageIndex === -1 ||
|
||||
this.displayedPages[quickNavPageIndex] !== this.activeViewerPage
|
||||
@ -300,9 +300,7 @@ export class FileWorkloadComponent {
|
||||
const page = this._firstSelectedAnnotation.pageNumber;
|
||||
const pageIdx = this.displayedPages.indexOf(page);
|
||||
const annotationsOnPage = this.displayedAnnotations[page].annotations;
|
||||
const idx = annotationsOnPage.findIndex(
|
||||
(a) => a.id === this._firstSelectedAnnotation.id
|
||||
);
|
||||
const idx = annotationsOnPage.findIndex(a => a.id === this._firstSelectedAnnotation.id);
|
||||
|
||||
if ($event.key === 'ArrowDown') {
|
||||
if (idx + 1 !== annotationsOnPage.length) {
|
||||
|
||||
@ -102,7 +102,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
this.deselectAllAnnotations();
|
||||
}
|
||||
|
||||
const annotationsFromViewer = annotations.map((ann) =>
|
||||
const annotationsFromViewer = annotations.map(ann =>
|
||||
this.instance.annotManager.getAnnotationById(ann.id)
|
||||
);
|
||||
this.instance.annotManager.selectAnnotations(annotationsFromViewer);
|
||||
@ -112,7 +112,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
|
||||
deselectAnnotations(annotations: AnnotationWrapper[]) {
|
||||
this.instance.annotManager.deselectAnnotations(
|
||||
annotations.map((ann) => this.instance.annotManager.getAnnotationById(ann.id))
|
||||
annotations.map(ann => this.instance.annotManager.getAnnotationById(ann.id))
|
||||
);
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
css: this._convertPath('/assets/pdftron/stylesheet.css')
|
||||
},
|
||||
this.viewer.nativeElement
|
||||
).then((instance) => {
|
||||
).then(instance => {
|
||||
this.instance = instance;
|
||||
this._disableElements();
|
||||
this._disableHotkeys();
|
||||
@ -149,7 +149,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
|
||||
instance.annotManager.on('annotationSelected', (annotations, action) => {
|
||||
this.annotationSelected.emit(
|
||||
instance.annotManager.getSelectedAnnotations().map((ann) => ann.Id)
|
||||
instance.annotManager.getSelectedAnnotations().map(ann => ann.Id)
|
||||
);
|
||||
if (action === 'deselected') {
|
||||
this._toggleRectangleAnnotationAction(true);
|
||||
@ -162,7 +162,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
}
|
||||
});
|
||||
|
||||
instance.annotManager.on('annotationChanged', (annotations) => {
|
||||
instance.annotManager.on('annotationChanged', annotations => {
|
||||
// when a rectangle is drawn,
|
||||
// it returns one annotation with tool name 'AnnotationCreateRectangle;
|
||||
// this will auto select rectangle after drawing
|
||||
@ -174,7 +174,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
}
|
||||
});
|
||||
|
||||
instance.docViewer.on('pageNumberUpdated', (pageNumber) => {
|
||||
instance.docViewer.on('pageNumberUpdated', pageNumber => {
|
||||
if (this.shouldDeselectAnnotationsOnPageChange) {
|
||||
this.deselectAllAnnotations();
|
||||
}
|
||||
@ -183,7 +183,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
|
||||
instance.docViewer.on('documentLoaded', this._documentLoaded);
|
||||
|
||||
instance.docViewer.on('keyUp', ($event) => {
|
||||
instance.docViewer.on('keyUp', $event => {
|
||||
// arrows and full-screen
|
||||
if ($event.target?.tagName?.toLowerCase() !== 'input') {
|
||||
if ($event.key.startsWith('Arrow') || $event.key === 'f') {
|
||||
@ -259,7 +259,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
'annotationGroupButton'
|
||||
]);
|
||||
|
||||
this.instance.setHeaderItems((header) => {
|
||||
this.instance.setHeaderItems(header => {
|
||||
const originalHeaderItems = header.getItems();
|
||||
originalHeaderItems.splice(8, 0, {
|
||||
type: 'divider',
|
||||
@ -289,8 +289,8 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
}
|
||||
|
||||
const annotationWrappers = viewerAnnotations
|
||||
.map((va) => this.annotations.find((a) => a.id === va.Id))
|
||||
.filter((va) => !!va);
|
||||
.map(va => this.annotations.find(a => a.id === va.Id))
|
||||
.filter(va => !!va);
|
||||
this.instance.annotationPopup.update([]);
|
||||
|
||||
if (annotationWrappers.length === 0) {
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<button class="scroll-button pointer" *ngIf="showScrollButton()" (click)="scroll()">
|
||||
<button (click)="scroll()" *ngIf="showScrollButton()" class="scroll-button pointer">
|
||||
<mat-icon svgIcon="red:arrow-down-o"></mat-icon>
|
||||
</button>
|
||||
|
||||
@ -37,7 +37,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
}
|
||||
|
||||
get selectedReviewersList(): string[] {
|
||||
return this.selectedMembersList.filter((m) => this.selectedApproversList.indexOf(m) === -1);
|
||||
return this.selectedMembersList.filter(m => this.selectedApproversList.indexOf(m) === -1);
|
||||
}
|
||||
|
||||
get selectedMembersList(): string[] {
|
||||
@ -45,20 +45,20 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
}
|
||||
|
||||
get ownersSelectOptions() {
|
||||
return this.userService.managerUsers.map((m) => m.userId);
|
||||
return this.userService.managerUsers.map(m => m.userId);
|
||||
}
|
||||
|
||||
get membersSelectOptions() {
|
||||
const searchQuery = this.searchForm.get('query').value;
|
||||
return this.userService.eligibleUsers
|
||||
.filter((user) =>
|
||||
.filter(user =>
|
||||
this.userService
|
||||
.getNameForId(user.userId)
|
||||
.toLowerCase()
|
||||
.includes(searchQuery.toLowerCase())
|
||||
)
|
||||
.filter((user) => this.selectedOwnerId !== user.userId)
|
||||
.map((user) => user.userId);
|
||||
.filter(user => this.selectedOwnerId !== user.userId)
|
||||
.map(user => user.userId);
|
||||
}
|
||||
|
||||
get valid(): boolean {
|
||||
@ -161,7 +161,7 @@ export class TeamMembersManagerComponent implements OnInit {
|
||||
this.searchForm = this._formBuilder.group({
|
||||
query: ['']
|
||||
});
|
||||
this.teamForm.get('owner').valueChanges.subscribe((owner) => {
|
||||
this.teamForm.get('owner').valueChanges.subscribe(owner => {
|
||||
if (!this.isApprover(owner)) {
|
||||
this.toggleApprover(owner);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ export class AddDossierDialogComponent {
|
||||
const dossier: Dossier = this._formToObject();
|
||||
|
||||
const foundDossier = this._appStateService.allDossiers.find(
|
||||
(p) => p.dossier.dossierId === dossier.dossierId
|
||||
p => p.dossier.dossierId === dossier.dossierId
|
||||
);
|
||||
if (foundDossier) {
|
||||
dossier.memberIds = foundDossier.memberIds;
|
||||
@ -80,7 +80,7 @@ export class AddDossierDialogComponent {
|
||||
dossierTemplateChanged(dossierTemplateId) {
|
||||
// get current selected dossierTemplate
|
||||
const dossierTemplate = this.dossierTemplates.find(
|
||||
(r) => r.dossierTemplateId === dossierTemplateId
|
||||
r => r.dossierTemplateId === dossierTemplateId
|
||||
);
|
||||
if (dossierTemplate) {
|
||||
// update dropdown values
|
||||
@ -95,7 +95,7 @@ export class AddDossierDialogComponent {
|
||||
}
|
||||
|
||||
private _filterInvalidDossierTemplates() {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter((r) => {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter(r => {
|
||||
const notYetValid = !!r.validFrom && moment(r.validFrom).isAfter(moment());
|
||||
const notValidAnymore = !!r.validTo && moment(r.validTo).add(1, 'd').isBefore(moment());
|
||||
return !(notYetValid || notValidAnymore);
|
||||
|
||||
@ -74,7 +74,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
if (this.data.mode === 'reviewer') {
|
||||
await this._statusControllerService
|
||||
.setFileReviewerForList(
|
||||
this.data.files.map((f) => f.fileId),
|
||||
this.data.files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId,
|
||||
selectedUser
|
||||
)
|
||||
@ -82,7 +82,7 @@ export class AssignReviewerApproverDialogComponent {
|
||||
} else {
|
||||
await this._statusControllerService
|
||||
.setStatusUnderApprovalForList(
|
||||
this.data.files.map((f) => f.fileId),
|
||||
this.data.files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId,
|
||||
selectedUser
|
||||
)
|
||||
|
||||
@ -37,7 +37,7 @@ export class DocumentInfoDialogComponent implements OnInit {
|
||||
await this._fileAttributesService
|
||||
.getFileAttributesConfiguration(this._dossier.dossierTemplateId)
|
||||
.toPromise()
|
||||
).fileAttributeConfigs.filter((attr) => attr.editable);
|
||||
).fileAttributeConfigs.filter(attr => attr.editable);
|
||||
const formConfig = this.attributes.reduce(
|
||||
(acc, attr) => ({
|
||||
...acc,
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
<div class="dialog-content">
|
||||
<redaction-dictionary-manager
|
||||
#dictionaryManager
|
||||
[withFloatingActions]="false"
|
||||
[canEdit]="canEdit"
|
||||
[initialEntries]="dossier.type?.entries"
|
||||
[withFloatingActions]="false"
|
||||
></redaction-dictionary-manager>
|
||||
</div>
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ import { EditDossierDictionaryComponent } from './dictionary/edit-dossier-dictio
|
||||
import { EditDossierTeamMembersComponent } from './team-members/edit-dossier-team-members.component';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-edit-dossier-dialog',
|
||||
templateUrl: './edit-dossier-dialog.component.html',
|
||||
styleUrls: ['./edit-dossier-dialog.component.scss']
|
||||
})
|
||||
@ -50,7 +49,7 @@ export class EditDossierDialogComponent {
|
||||
}
|
||||
|
||||
get activeNavItem(): { key: string; title?: string } {
|
||||
return this.navItems.find((item) => item.key === this.activeNav);
|
||||
return this.navItems.find(item => item.key === this.activeNav);
|
||||
}
|
||||
|
||||
get activeComponent(): EditDossierSectionInterface {
|
||||
|
||||
@ -94,7 +94,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
||||
}
|
||||
|
||||
private _filterInvalidDossierTemplates() {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter((r) => {
|
||||
this.dossierTemplates = this._appStateService.dossierTemplates.filter(r => {
|
||||
if (this.dossierWrapper?.dossierTemplateId === r.dossierTemplateId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -40,8 +40,8 @@ export class ForceRedactionDialogComponent implements OnInit {
|
||||
async ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._appStateService.activeDossier.dossierTemplateId)
|
||||
.subscribe((data) => {
|
||||
data.map((lbm) => {
|
||||
.subscribe(data => {
|
||||
data.map(lbm => {
|
||||
this.legalOptions.push({
|
||||
legalBasis: lbm.reason,
|
||||
description: lbm.description,
|
||||
|
||||
@ -53,7 +53,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
get displayedDictionaryLabel() {
|
||||
const dictType = this.redactionForm.get('dictionary').value;
|
||||
if (dictType) {
|
||||
return this.redactionDictionaries.find((d) => d.type === dictType).label;
|
||||
return this.redactionDictionaries.find(d => d.type === dictType).label;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -61,8 +61,8 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
async ngOnInit() {
|
||||
this._legalBasisMappingControllerService
|
||||
.getLegalBasisMapping(this._appStateService.activeDossier.dossierTemplateId)
|
||||
.subscribe((data) => {
|
||||
data.map((lbm) => {
|
||||
.subscribe(data => {
|
||||
data.map(lbm => {
|
||||
this.legalOptions.push({
|
||||
legalBasis: lbm.reason,
|
||||
description: lbm.description,
|
||||
@ -105,7 +105,7 @@ export class ManualAnnotationDialogComponent implements OnInit {
|
||||
this._manualAnnotationService
|
||||
.addAnnotation(this.manualRedactionEntryWrapper.manualRedactionEntry)
|
||||
.subscribe(
|
||||
(response) => {
|
||||
response => {
|
||||
this.dialogRef.close(
|
||||
new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response)
|
||||
);
|
||||
|
||||
@ -171,9 +171,9 @@
|
||||
</cdk-virtual-scroll-viewport>
|
||||
|
||||
<redaction-scroll-button
|
||||
[scrollViewport]="scrollBar"
|
||||
[itemSize]="itemSize"
|
||||
*ngIf="scrollBar && itemSize > 0"
|
||||
[itemSize]="itemSize"
|
||||
[scrollViewport]="scrollBar"
|
||||
></redaction-scroll-button>
|
||||
</div>
|
||||
|
||||
@ -182,8 +182,8 @@
|
||||
(filtersChanged)="filtersChanged($event)"
|
||||
*ngIf="allEntities.length"
|
||||
[documentsChartData]="documentsChartData"
|
||||
[filters]="detailsContainerFilters"
|
||||
[dossiersChartData]="dossiersChartData"
|
||||
[filters]="detailsContainerFilters"
|
||||
></redaction-dossier-listing-details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -7,10 +7,10 @@ import { groupBy } from '@utils/functions';
|
||||
import { FilterModel } from '@shared/components/filter/model/filter.model';
|
||||
import {
|
||||
annotationFilterChecker,
|
||||
processFilters,
|
||||
dossierMemberChecker,
|
||||
dossierStatusChecker,
|
||||
dossierTemplateChecker
|
||||
dossierTemplateChecker,
|
||||
processFilters
|
||||
} from '@shared/components/filter/utils/filter-utils';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -48,13 +48,11 @@ export class DossierListingScreenComponent
|
||||
statusFilters: []
|
||||
};
|
||||
readonly itemSize = 85;
|
||||
@ViewChild(CdkVirtualScrollViewport) scrollBar: CdkVirtualScrollViewport;
|
||||
protected readonly _searchKey = 'name';
|
||||
protected readonly _sortKey = 'dossier-listing';
|
||||
private _dossierAutoUpdateTimer: Subscription;
|
||||
private _lastScrollPosition: number;
|
||||
|
||||
@ViewChild(CdkVirtualScrollViewport) scrollBar: CdkVirtualScrollViewport;
|
||||
|
||||
@ViewChild('statusFilter') private _statusFilterComponent: FilterComponent;
|
||||
@ViewChild('peopleFilter') private _peopleFilterComponent: FilterComponent;
|
||||
@ViewChild('needsWorkFilter') private _needsWorkFilterComponent: FilterComponent;
|
||||
@ -87,8 +85,7 @@ export class DossierListingScreenComponent
|
||||
}
|
||||
|
||||
get activeDossiersCount() {
|
||||
return this.allEntities.filter((p) => p.dossier.status === Dossier.StatusEnum.ACTIVE)
|
||||
.length;
|
||||
return this.allEntities.filter(p => p.dossier.status === Dossier.StatusEnum.ACTIVE).length;
|
||||
}
|
||||
|
||||
get inactiveDossiersCount() {
|
||||
@ -142,10 +139,10 @@ export class DossierListingScreenComponent
|
||||
this._routerEventsScrollPositionSub = this._router.events
|
||||
.pipe(
|
||||
filter(
|
||||
(events) => events instanceof NavigationStart || events instanceof NavigationEnd
|
||||
events => events instanceof NavigationStart || events instanceof NavigationEnd
|
||||
)
|
||||
)
|
||||
.subscribe((event) => {
|
||||
.subscribe(event => {
|
||||
if (event instanceof NavigationStart && event.url !== '/main/dossiers') {
|
||||
this._lastScrollPosition = this.scrollBar.measureScrollOffset('top');
|
||||
}
|
||||
@ -186,7 +183,7 @@ export class DossierListingScreenComponent
|
||||
}
|
||||
|
||||
openAddDossierDialog(): void {
|
||||
this._dialogService.openAddDossierDialog((addResponse) => {
|
||||
this._dialogService.openAddDossierDialog(addResponse => {
|
||||
this._calculateData();
|
||||
this._router.navigate([`/main/dossiers/${addResponse.dossier.dossierId}`]);
|
||||
if (addResponse.addMembers) {
|
||||
@ -205,7 +202,7 @@ export class DossierListingScreenComponent
|
||||
|
||||
protected _preFilter() {
|
||||
this.detailsContainerFilters = {
|
||||
statusFilters: this.statusFilters.map((f) => ({ ...f }))
|
||||
statusFilters: this.statusFilters.map(f => ({ ...f }))
|
||||
};
|
||||
}
|
||||
|
||||
@ -241,16 +238,16 @@ export class DossierListingScreenComponent
|
||||
const allDistinctPeople = new Set<string>();
|
||||
const allDistinctNeedsWork = new Set<string>();
|
||||
const allDistinctDossierTemplates = new Set<string>();
|
||||
this.allEntities.forEach((entry) => {
|
||||
this.allEntities.forEach(entry => {
|
||||
// all people
|
||||
entry.dossier.memberIds.forEach((memberId) => allDistinctPeople.add(memberId));
|
||||
entry.dossier.memberIds.forEach(memberId => allDistinctPeople.add(memberId));
|
||||
// file statuses
|
||||
entry.files.forEach((file) => {
|
||||
entry.files.forEach(file => {
|
||||
allDistinctFileStatus.add(file.status);
|
||||
});
|
||||
|
||||
// Needs work
|
||||
entry.files.forEach((file) => {
|
||||
entry.files.forEach(file => {
|
||||
if (this.permissionsService.fileRequiresReanalysis(file))
|
||||
allDistinctNeedsWork.add('analysis');
|
||||
if (entry.hintsOnly) allDistinctNeedsWork.add('hint');
|
||||
@ -264,7 +261,7 @@ export class DossierListingScreenComponent
|
||||
});
|
||||
|
||||
const statusFilters = [];
|
||||
allDistinctFileStatus.forEach((status) => {
|
||||
allDistinctFileStatus.forEach(status => {
|
||||
statusFilters.push({
|
||||
key: status,
|
||||
label: this._translateService.instant(status)
|
||||
@ -274,7 +271,7 @@ export class DossierListingScreenComponent
|
||||
this.statusFilters = processFilters(this.statusFilters, statusFilters);
|
||||
|
||||
const peopleFilters = [];
|
||||
allDistinctPeople.forEach((userId) => {
|
||||
allDistinctPeople.forEach(userId => {
|
||||
peopleFilters.push({
|
||||
key: userId,
|
||||
label: this._userService.getNameForId(userId)
|
||||
@ -283,7 +280,7 @@ export class DossierListingScreenComponent
|
||||
this.peopleFilters = processFilters(this.peopleFilters, peopleFilters);
|
||||
|
||||
const needsWorkFilters = [];
|
||||
allDistinctNeedsWork.forEach((type) => {
|
||||
allDistinctNeedsWork.forEach(type => {
|
||||
needsWorkFilters.push({
|
||||
key: type,
|
||||
label: this._translateService.instant('filter.' + type)
|
||||
@ -296,7 +293,7 @@ export class DossierListingScreenComponent
|
||||
this.needsWorkFilters = processFilters(this.needsWorkFilters, needsWorkFilters);
|
||||
|
||||
const dossierTemplateFilters = [];
|
||||
allDistinctDossierTemplates.forEach((dossierTemplateId) => {
|
||||
allDistinctDossierTemplates.forEach(dossierTemplateId => {
|
||||
dossierTemplateFilters.push({
|
||||
key: dossierTemplateId,
|
||||
label: this._appStateService.getDossierTemplateById(dossierTemplateId).name
|
||||
|
||||
@ -56,8 +56,8 @@
|
||||
<!-- ></redaction-circle-button>-->
|
||||
|
||||
<redaction-file-download-btn
|
||||
[file]="allEntities"
|
||||
[dossier]="activeDossier"
|
||||
[file]="allEntities"
|
||||
tooltipPosition="below"
|
||||
></redaction-file-download-btn>
|
||||
|
||||
@ -311,9 +311,9 @@
|
||||
</cdk-virtual-scroll-viewport>
|
||||
|
||||
<redaction-scroll-button
|
||||
[scrollViewport]="scrollBar"
|
||||
[itemSize]="itemSize"
|
||||
*ngIf="scrollBar && itemSize > 0"
|
||||
[itemSize]="itemSize"
|
||||
[scrollViewport]="scrollBar"
|
||||
></redaction-scroll-button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ export class DossierOverviewScreenComponent
|
||||
statusFilters: FilterModel[];
|
||||
} = { needsWorkFilters: [], statusFilters: [] };
|
||||
readonly itemSize = 80;
|
||||
@ViewChild(CdkVirtualScrollViewport) scrollBar: CdkVirtualScrollViewport;
|
||||
protected readonly _searchKey = 'searchField';
|
||||
protected readonly _selectionKey = 'fileId';
|
||||
protected readonly _sortKey = 'dossier-overview';
|
||||
@ -59,9 +60,6 @@ export class DossierOverviewScreenComponent
|
||||
private _fileChangedSub: Subscription;
|
||||
private _lastScrollPosition: number;
|
||||
private _lastOpenedFileId = '';
|
||||
|
||||
@ViewChild(CdkVirtualScrollViewport) scrollBar: CdkVirtualScrollViewport;
|
||||
|
||||
@ViewChild('statusFilter') private _statusFilterComponent: FilterComponent;
|
||||
@ViewChild('peopleFilter') private _peopleFilterComponent: FilterComponent;
|
||||
@ViewChild('needsWorkFilter') private _needsWorkFilterComponent: FilterComponent;
|
||||
@ -119,7 +117,7 @@ export class DossierOverviewScreenComponent
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._userPreferenceControllerService.getAllUserAttributes().subscribe((attributes) => {
|
||||
this._userPreferenceControllerService.getAllUserAttributes().subscribe(attributes => {
|
||||
if (attributes === null || attributes === undefined) return;
|
||||
const key = 'Dossier-Recent-' + this.activeDossier.dossierId;
|
||||
if (attributes[key]?.length > 0) {
|
||||
@ -145,7 +143,7 @@ export class DossierOverviewScreenComponent
|
||||
});
|
||||
|
||||
this._routerEventsScrollPositionSub = this._router.events
|
||||
.pipe(filter((events) => events instanceof NavigationStart))
|
||||
.pipe(filter(events => events instanceof NavigationStart))
|
||||
.subscribe((event: NavigationStart) => {
|
||||
if (!event.url.endsWith(this._appStateService.activeDossierId)) {
|
||||
this._lastScrollPosition = this.scrollBar.measureScrollOffset('top');
|
||||
@ -286,8 +284,8 @@ export class DossierOverviewScreenComponent
|
||||
|
||||
protected _preFilter() {
|
||||
this.detailsContainerFilters = {
|
||||
needsWorkFilters: this.needsWorkFilters.map((f) => ({ ...f })),
|
||||
statusFilters: this.statusFilters.map((f) => ({ ...f }))
|
||||
needsWorkFilters: this.needsWorkFilters.map(f => ({ ...f })),
|
||||
statusFilters: this.statusFilters.map(f => ({ ...f }))
|
||||
};
|
||||
}
|
||||
|
||||
@ -314,18 +312,18 @@ export class DossierOverviewScreenComponent
|
||||
const allDistinctNeedsWork = new Set<string>();
|
||||
|
||||
// All people
|
||||
this.allEntities.forEach((file) => allDistinctPeople.add(file.currentReviewer));
|
||||
this.allEntities.forEach(file => allDistinctPeople.add(file.currentReviewer));
|
||||
|
||||
// File statuses
|
||||
this.allEntities.forEach((file) => allDistinctFileStatusWrapper.add(file.status));
|
||||
this.allEntities.forEach(file => allDistinctFileStatusWrapper.add(file.status));
|
||||
|
||||
// Added dates
|
||||
this.allEntities.forEach((file) =>
|
||||
this.allEntities.forEach(file =>
|
||||
allDistinctAddedDates.add(moment(file.added).format('DD/MM/YYYY'))
|
||||
);
|
||||
|
||||
// Needs work
|
||||
this.allEntities.forEach((file) => {
|
||||
this.allEntities.forEach(file => {
|
||||
if (this.permissionsService.fileRequiresReanalysis(file))
|
||||
allDistinctNeedsWork.add('analysis');
|
||||
if (file.hintsOnly) allDistinctNeedsWork.add('hint');
|
||||
@ -337,7 +335,7 @@ export class DossierOverviewScreenComponent
|
||||
});
|
||||
|
||||
const statusFilters = [];
|
||||
allDistinctFileStatusWrapper.forEach((status) => {
|
||||
allDistinctFileStatusWrapper.forEach(status => {
|
||||
statusFilters.push({
|
||||
key: status,
|
||||
label: this._translateService.instant(status)
|
||||
@ -356,7 +354,7 @@ export class DossierOverviewScreenComponent
|
||||
label: this._translateService.instant('initials-avatar.unassigned')
|
||||
});
|
||||
}
|
||||
allDistinctPeople.forEach((userId) => {
|
||||
allDistinctPeople.forEach(userId => {
|
||||
peopleFilters.push({
|
||||
key: userId,
|
||||
label: this._userService.getNameForId(userId)
|
||||
@ -365,7 +363,7 @@ export class DossierOverviewScreenComponent
|
||||
this.peopleFilters = processFilters(this.peopleFilters, peopleFilters);
|
||||
|
||||
const needsWorkFilters = [];
|
||||
allDistinctNeedsWork.forEach((type) => {
|
||||
allDistinctNeedsWork.forEach(type => {
|
||||
needsWorkFilters.push({
|
||||
key: type,
|
||||
label: this._translateService.instant('filter.' + type)
|
||||
|
||||
@ -118,8 +118,8 @@
|
||||
permissionsService.canAssignUser() &&
|
||||
appStateService.activeFile.currentReviewer
|
||||
"
|
||||
icon="red:edit"
|
||||
[tooltip]="assignTooltip"
|
||||
icon="red:edit"
|
||||
tooltipPosition="below"
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
@ -174,16 +174,16 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
}
|
||||
|
||||
updateViewMode() {
|
||||
const annotations = this._getAnnotations((a) => a.getCustomData('redacto-manager'));
|
||||
const redactions = annotations.filter((a) => a.getCustomData('redaction'));
|
||||
const annotations = this._getAnnotations(a => a.getCustomData('redacto-manager'));
|
||||
const redactions = annotations.filter(a => a.getCustomData('redaction'));
|
||||
|
||||
switch (this.viewMode) {
|
||||
case 'STANDARD': {
|
||||
this._setAnnotationsColor(redactions, 'annotationColor');
|
||||
const standardEntries = annotations.filter(
|
||||
(a) => !a.getCustomData('changeLogRemoved')
|
||||
a => !a.getCustomData('changeLogRemoved')
|
||||
);
|
||||
const nonStandardEntries = annotations.filter((a) =>
|
||||
const nonStandardEntries = annotations.filter(a =>
|
||||
a.getCustomData('changeLogRemoved')
|
||||
);
|
||||
this._show(standardEntries);
|
||||
@ -191,19 +191,15 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
break;
|
||||
}
|
||||
case 'DELTA': {
|
||||
const changeLogEntries = annotations.filter((a) => a.getCustomData('changeLog'));
|
||||
const nonChangeLogEntries = annotations.filter(
|
||||
(a) => !a.getCustomData('changeLog')
|
||||
);
|
||||
const changeLogEntries = annotations.filter(a => a.getCustomData('changeLog'));
|
||||
const nonChangeLogEntries = annotations.filter(a => !a.getCustomData('changeLog'));
|
||||
this._setAnnotationsColor(redactions, 'annotationColor');
|
||||
this._show(changeLogEntries);
|
||||
this._hide(nonChangeLogEntries);
|
||||
break;
|
||||
}
|
||||
case 'REDACTED': {
|
||||
const nonRedactionEntries = annotations.filter(
|
||||
(a) => !a.getCustomData('redaction')
|
||||
);
|
||||
const nonRedactionEntries = annotations.filter(a => !a.getCustomData('redaction'));
|
||||
this._setAnnotationsColor(redactions, 'redactionColor');
|
||||
this._show(redactions);
|
||||
this._hide(nonRedactionEntries);
|
||||
@ -294,10 +290,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
handleAnnotationSelected(annotationIds: string[]) {
|
||||
this.selectedAnnotations = annotationIds
|
||||
.map((annotationId) =>
|
||||
this.annotations.find((annotationWrapper) => annotationWrapper.id === annotationId)
|
||||
.map(annotationId =>
|
||||
this.annotations.find(annotationWrapper => annotationWrapper.id === annotationId)
|
||||
)
|
||||
.filter((ann) => ann !== undefined);
|
||||
.filter(ann => ann !== undefined);
|
||||
if (this.selectedAnnotations.length > 1) {
|
||||
this._workloadComponent.multiSelectActive = true;
|
||||
}
|
||||
@ -338,9 +334,9 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
this.activeViewer.annotManager.deleteAnnotation(annotation);
|
||||
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||
const distinctPages = $event.manualRedactionEntry.positions
|
||||
.map((p) => p.page)
|
||||
.map(p => p.page)
|
||||
.filter((item, pos, self) => self.indexOf(item) === pos);
|
||||
distinctPages.forEach((page) => {
|
||||
distinctPages.forEach(page => {
|
||||
this._cleanupAndRedrawManualAnnotationsForEntirePage(page);
|
||||
});
|
||||
}
|
||||
@ -507,7 +503,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
this.fileData.fileStatus.lastUploaded,
|
||||
'response'
|
||||
)
|
||||
.subscribe((data) => {
|
||||
.subscribe(data => {
|
||||
download(data, this.fileData.fileStatus.filename);
|
||||
});
|
||||
}
|
||||
@ -566,7 +562,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
|
||||
private _loadFileData(performUpdate: boolean = false) {
|
||||
return this._fileDownloadService.loadActiveFileData().pipe(
|
||||
tap((fileDataModel) => {
|
||||
tap(fileDataModel => {
|
||||
if (fileDataModel.fileStatus.isWorkable) {
|
||||
if (performUpdate) {
|
||||
this.fileData.redactionLog = fileDataModel.redactionLog;
|
||||
@ -600,44 +596,40 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
/* Get the documentElement (<html>) to display the page in fullscreen */
|
||||
|
||||
private _cleanupAndRedrawManualAnnotations() {
|
||||
this._fileDownloadService
|
||||
.loadActiveFileManualAnnotations()
|
||||
.subscribe((manualRedactions) => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
this.rebuildFilters();
|
||||
this._annotationDrawService.drawAnnotations(
|
||||
this._instance,
|
||||
this.annotationData.allAnnotations,
|
||||
this.hideSkipped
|
||||
);
|
||||
});
|
||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe(manualRedactions => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
this.rebuildFilters();
|
||||
this._annotationDrawService.drawAnnotations(
|
||||
this._instance,
|
||||
this.annotationData.allAnnotations,
|
||||
this.hideSkipped
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private async _cleanupAndRedrawManualAnnotationsForEntirePage(page: number) {
|
||||
const currentPageAnnotations = this.annotations.filter((a) => a.pageNumber === page);
|
||||
const currentPageAnnotationIds = currentPageAnnotations.map((a) => a.id);
|
||||
const currentPageAnnotations = this.annotations.filter(a => a.pageNumber === page);
|
||||
const currentPageAnnotationIds = currentPageAnnotations.map(a => a.id);
|
||||
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||
|
||||
this._fileDownloadService
|
||||
.loadActiveFileManualAnnotations()
|
||||
.subscribe((manualRedactions) => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
this.rebuildFilters();
|
||||
if (this.viewMode === 'STANDARD') {
|
||||
currentPageAnnotationIds.forEach((id) => {
|
||||
this._findAndDeleteAnnotation(id);
|
||||
});
|
||||
const newPageAnnotations = this.annotations.filter(
|
||||
(item) => item.pageNumber === page
|
||||
);
|
||||
this._handleDeltaAnnotationFilters(currentPageAnnotations, newPageAnnotations);
|
||||
this._annotationDrawService.drawAnnotations(
|
||||
this._instance,
|
||||
newPageAnnotations,
|
||||
this.hideSkipped
|
||||
);
|
||||
}
|
||||
});
|
||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe(manualRedactions => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
this.rebuildFilters();
|
||||
if (this.viewMode === 'STANDARD') {
|
||||
currentPageAnnotationIds.forEach(id => {
|
||||
this._findAndDeleteAnnotation(id);
|
||||
});
|
||||
const newPageAnnotations = this.annotations.filter(
|
||||
item => item.pageNumber === page
|
||||
);
|
||||
this._handleDeltaAnnotationFilters(currentPageAnnotations, newPageAnnotations);
|
||||
this._annotationDrawService.drawAnnotations(
|
||||
this._instance,
|
||||
newPageAnnotations,
|
||||
this.hideSkipped
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private _handleDeltaAnnotationFilters(
|
||||
@ -645,8 +637,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
newPageAnnotations: AnnotationWrapper[]
|
||||
) {
|
||||
const hasAnyFilterSet =
|
||||
this.primaryFilters.find((f) => f.checked || f.indeterminate) ||
|
||||
this.secondaryFilters.find((f) => f.checked || f.indeterminate);
|
||||
this.primaryFilters.find(f => f.checked || f.indeterminate) ||
|
||||
this.secondaryFilters.find(f => f.checked || f.indeterminate);
|
||||
if (hasAnyFilterSet) {
|
||||
const oldPageSpecificFilters =
|
||||
this._annotationProcessingService.getAnnotationFilter(currentPageAnnotations);
|
||||
@ -706,7 +698,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
}
|
||||
|
||||
private _handleIgnoreAnnotationsDrawing() {
|
||||
const ignored = this._getAnnotations((a) => a.getCustomData('skipped'));
|
||||
const ignored = this._getAnnotations(a => a.getCustomData('skipped'));
|
||||
return this.hideSkipped ? this._hide(ignored) : this._show(ignored);
|
||||
}
|
||||
|
||||
@ -724,7 +716,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
|
||||
}
|
||||
|
||||
private _setAnnotationsColor(annotations, customData: string) {
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
annotation['StrokeColor'] = annotation.getCustomData(customData);
|
||||
});
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ export class AnnotationActionsService {
|
||||
annotationsChanged: EventEmitter<AnnotationWrapper>
|
||||
) {
|
||||
$event?.stopPropagation();
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.approveRequest(
|
||||
annotation.id,
|
||||
@ -45,7 +45,7 @@ export class AnnotationActionsService {
|
||||
annotationsChanged: EventEmitter<AnnotationWrapper>
|
||||
) {
|
||||
$event?.stopPropagation();
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.declineOrRemoveRequest(annotation),
|
||||
annotation,
|
||||
@ -60,8 +60,8 @@ export class AnnotationActionsService {
|
||||
annotationsChanged: EventEmitter<AnnotationWrapper>
|
||||
) {
|
||||
$event?.stopPropagation();
|
||||
this._dialogService.openForceRedactionDialog($event, (request) => {
|
||||
annotations.forEach((annotation) => {
|
||||
this._dialogService.openForceRedactionDialog($event, request => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.forceRedaction({
|
||||
...request,
|
||||
@ -85,7 +85,7 @@ export class AnnotationActionsService {
|
||||
annotations,
|
||||
removeFromDictionary,
|
||||
() => {
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.removeOrSuggestRemoveAnnotation(
|
||||
annotation,
|
||||
@ -104,7 +104,7 @@ export class AnnotationActionsService {
|
||||
annotations: AnnotationWrapper[],
|
||||
annotationsChanged: EventEmitter<AnnotationWrapper>
|
||||
) {
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
const permissions = AnnotationPermissions.forUser(
|
||||
this._permissionsService.isApprover(),
|
||||
this._permissionsService.currentUser,
|
||||
@ -125,7 +125,7 @@ export class AnnotationActionsService {
|
||||
) {
|
||||
$event?.stopPropagation();
|
||||
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.undoRequest(annotation),
|
||||
annotation,
|
||||
@ -141,7 +141,7 @@ export class AnnotationActionsService {
|
||||
) {
|
||||
$event?.stopPropagation();
|
||||
|
||||
annotations.forEach((annotation) => {
|
||||
annotations.forEach(annotation => {
|
||||
this._processObsAndEmit(
|
||||
this._manualAnnotationService.addRecommendation(annotation),
|
||||
annotation,
|
||||
@ -156,7 +156,7 @@ export class AnnotationActionsService {
|
||||
): Record<string, unknown>[] {
|
||||
const availableActions = [];
|
||||
|
||||
const annotationPermissions = annotations.map((a) => ({
|
||||
const annotationPermissions = annotations.map(a => ({
|
||||
annotation: a,
|
||||
permissions: AnnotationPermissions.forUser(
|
||||
this._permissionsService.isApprover(),
|
||||
|
||||
@ -25,7 +25,7 @@ export class AnnotationDrawService {
|
||||
hideSkipped: boolean = false
|
||||
) {
|
||||
const annotations = [];
|
||||
annotationWrappers.forEach((annotation) => {
|
||||
annotationWrappers.forEach(annotation => {
|
||||
annotations.push(this.computeAnnotation(activeViewer, annotation, hideSkipped));
|
||||
});
|
||||
|
||||
@ -39,7 +39,7 @@ export class AnnotationDrawService {
|
||||
this._appStateService.activeDossierId,
|
||||
this._appStateService.activeFileId
|
||||
)
|
||||
.subscribe((sectionGrid) => {
|
||||
.subscribe(sectionGrid => {
|
||||
this.drawSections(activeViewer, sectionGrid);
|
||||
});
|
||||
}
|
||||
@ -49,7 +49,7 @@ export class AnnotationDrawService {
|
||||
const sections = [];
|
||||
for (const page of Object.keys(sectionGrid.rectanglesPerPage)) {
|
||||
const sectionRectangles: SectionRectangle[] = sectionGrid.rectanglesPerPage[page];
|
||||
sectionRectangles.forEach((sectionRectangle) => {
|
||||
sectionRectangles.forEach(sectionRectangle => {
|
||||
sections.push(
|
||||
this.computeSection(activeViewer, parseInt(page, 10), sectionRectangle)
|
||||
);
|
||||
@ -174,7 +174,7 @@ export class AnnotationDrawService {
|
||||
pageNumber: number
|
||||
): any[] {
|
||||
const pageHeight = activeViewer.docViewer.getPageHeight(pageNumber);
|
||||
return positions.map((p) => this._rectangleToQuad(p, activeViewer, pageHeight));
|
||||
return positions.map(p => this._rectangleToQuad(p, activeViewer, pageHeight));
|
||||
}
|
||||
|
||||
private _rectangleToQuad(
|
||||
|
||||
@ -24,7 +24,7 @@ export class AnnotationProcessingService {
|
||||
const filterMap = new Map<string, FilterModel>();
|
||||
const filters: FilterModel[] = [];
|
||||
|
||||
annotations?.forEach((a) => {
|
||||
annotations?.forEach(a => {
|
||||
const topLevelFilter =
|
||||
a.superType !== 'hint' &&
|
||||
a.superType !== 'redaction' &&
|
||||
@ -75,20 +75,18 @@ export class AnnotationProcessingService {
|
||||
): { [key: number]: { annotations: AnnotationWrapper[] } } {
|
||||
const obj = {};
|
||||
|
||||
const primaryFlatFilters = this._getFlatFilters(primaryFilters, (f) => f.checked);
|
||||
const secondaryFlatFilters = this._getFlatFilters(secondaryFilters, (f) => f.checked);
|
||||
const primaryFlatFilters = this._getFlatFilters(primaryFilters, f => f.checked);
|
||||
const secondaryFlatFilters = this._getFlatFilters(secondaryFilters, f => f.checked);
|
||||
|
||||
for (const annotation of annotations) {
|
||||
if (
|
||||
!this._matchesOne(primaryFlatFilters, (f) => this._checkByFilterKey(f, annotation))
|
||||
) {
|
||||
if (!this._matchesOne(primaryFlatFilters, f => this._checkByFilterKey(f, annotation))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
!this._matchesAll(
|
||||
secondaryFlatFilters,
|
||||
(f) =>
|
||||
f =>
|
||||
(!!f.checker && f.checker(annotation)) ||
|
||||
this._checkByFilterKey(f, annotation)
|
||||
)
|
||||
@ -112,7 +110,7 @@ export class AnnotationProcessingService {
|
||||
obj[pageNumber][annotation.superType]++;
|
||||
}
|
||||
|
||||
Object.keys(obj).map((page) => {
|
||||
Object.keys(obj).map(page => {
|
||||
obj[page].annotations = this._sortAnnotations(obj[page].annotations);
|
||||
});
|
||||
|
||||
@ -139,12 +137,12 @@ export class AnnotationProcessingService {
|
||||
private _getFlatFilters(filters: FilterModel[], filterBy?: (f: FilterModel) => boolean) {
|
||||
const flatFilters: FilterModel[] = [];
|
||||
|
||||
filters.forEach((filter) => {
|
||||
filters.forEach(filter => {
|
||||
flatFilters.push(filter);
|
||||
flatFilters.push(...filter.filters);
|
||||
});
|
||||
|
||||
return filterBy ? flatFilters.filter((f) => filterBy(f)) : flatFilters;
|
||||
return filterBy ? flatFilters.filter(f => filterBy(f)) : flatFilters;
|
||||
}
|
||||
|
||||
private _matchesOne = (
|
||||
|
||||
@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import {
|
||||
DictionaryControllerService,
|
||||
DossierTemplateControllerService,
|
||||
FileManagementControllerService,
|
||||
FileStatus,
|
||||
ManualRedactionControllerService,
|
||||
DossierTemplateControllerService
|
||||
ManualRedactionControllerService
|
||||
} from '@redaction/red-ui-http';
|
||||
import { AddDossierDialogComponent } from '../dialogs/add-dossier-dialog/add-dossier-dialog.component';
|
||||
import { RemoveAnnotationsDialogComponent } from '../dialogs/remove-annotations-dialog/remove-annotations-dialog.component';
|
||||
@ -65,7 +65,7 @@ export class DossiersDialogService {
|
||||
})
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result) {
|
||||
try {
|
||||
await this._fileManagementControllerService
|
||||
@ -96,7 +96,7 @@ export class DossiersDialogService {
|
||||
data: $event
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -113,11 +113,11 @@ export class DossiersDialogService {
|
||||
$event?.stopPropagation();
|
||||
|
||||
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this._manualAnnotationService
|
||||
.approveRequest(annotation.id)
|
||||
.subscribe((acceptResult) => {
|
||||
.subscribe(acceptResult => {
|
||||
if (callback) {
|
||||
callback(acceptResult);
|
||||
}
|
||||
@ -140,7 +140,7 @@ export class DossiersDialogService {
|
||||
maxWidth: '90vw'
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this._manualAnnotationService.declineOrRemoveRequest(annotation).subscribe(() => {
|
||||
rejectCallback();
|
||||
@ -159,7 +159,7 @@ export class DossiersDialogService {
|
||||
const ref = this._dialog.open(ForceRedactionDialogComponent, {
|
||||
...dialogConfig
|
||||
});
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -178,7 +178,7 @@ export class DossiersDialogService {
|
||||
...dialogConfig,
|
||||
data: { annotationsToRemove: annotations, removeFromDictionary: removeFromDictionary }
|
||||
});
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result) {
|
||||
if (cb) cb();
|
||||
}
|
||||
@ -200,7 +200,7 @@ export class DossiersDialogService {
|
||||
})
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe(async (result) => {
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
if (result) {
|
||||
await this._appStateService.deleteDossier(dossier);
|
||||
if (cb) cb();
|
||||
@ -219,7 +219,7 @@ export class DossiersDialogService {
|
||||
...dialogConfig,
|
||||
data: { dossierWrapper }
|
||||
});
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -240,7 +240,7 @@ export class DossiersDialogService {
|
||||
autoFocus: false,
|
||||
data: dossier
|
||||
});
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -256,7 +256,7 @@ export class DossiersDialogService {
|
||||
question: 'confirmation-dialog.assign-file-to-me.question'
|
||||
})
|
||||
});
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) cb(result);
|
||||
});
|
||||
}
|
||||
@ -286,7 +286,7 @@ export class DossiersDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) cb(result);
|
||||
});
|
||||
|
||||
@ -318,7 +318,7 @@ export class DossiersDialogService {
|
||||
autoFocus: true
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result && cb) {
|
||||
cb(result);
|
||||
}
|
||||
@ -339,7 +339,7 @@ export class DossiersDialogService {
|
||||
maxWidth: '90vw'
|
||||
});
|
||||
|
||||
ref.afterClosed().subscribe((result) => {
|
||||
ref.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this._manualAnnotationService
|
||||
.removeOrSuggestRemoveAnnotation(annotation)
|
||||
|
||||
@ -112,7 +112,7 @@ export class FileActionService {
|
||||
}
|
||||
|
||||
return this._statusControllerService.setStatusUnderApprovalForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
fileStatus.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId,
|
||||
approverId
|
||||
);
|
||||
@ -123,7 +123,7 @@ export class FileActionService {
|
||||
fileStatus = [fileStatus];
|
||||
}
|
||||
return this._statusControllerService.setStatusApprovedForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
fileStatus.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
@ -133,7 +133,7 @@ export class FileActionService {
|
||||
fileStatus = [fileStatus];
|
||||
}
|
||||
return this._statusControllerService.setStatusUnderReviewForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
fileStatus.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
@ -143,7 +143,7 @@ export class FileActionService {
|
||||
fileStatus = [fileStatus];
|
||||
}
|
||||
return this._reanalysisControllerService.ocrFiles(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
fileStatus.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
);
|
||||
}
|
||||
@ -170,7 +170,7 @@ export class FileActionService {
|
||||
}
|
||||
await this._statusControllerService
|
||||
.setFileReviewerForList(
|
||||
fileStatus.map((f) => f.fileId),
|
||||
fileStatus.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId,
|
||||
this._userService.userId
|
||||
)
|
||||
|
||||
@ -94,7 +94,7 @@ export class ManualAnnotationService {
|
||||
.pipe(
|
||||
tap(
|
||||
() => this._notify(this._getMessage('approve', addToDictionary)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('approve', addToDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
@ -117,7 +117,7 @@ export class ManualAnnotationService {
|
||||
this._notify(
|
||||
this._getMessage('undo', annotationWrapper.isModifyDictionary)
|
||||
),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('undo', annotationWrapper.isModifyDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
@ -144,7 +144,7 @@ export class ManualAnnotationService {
|
||||
this._notify(
|
||||
this._getMessage('decline', annotationWrapper.isModifyDictionary)
|
||||
),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage(
|
||||
'decline',
|
||||
@ -169,7 +169,7 @@ export class ManualAnnotationService {
|
||||
this._notify(
|
||||
this._getMessage('undo', annotationWrapper.isModifyDictionary)
|
||||
),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage(
|
||||
'undo',
|
||||
@ -203,7 +203,7 @@ export class ManualAnnotationService {
|
||||
.pipe(
|
||||
tap(
|
||||
() => this._notify(this._getMessage('decline', false)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('decline', false, true),
|
||||
NotificationType.ERROR,
|
||||
@ -225,7 +225,7 @@ export class ManualAnnotationService {
|
||||
.pipe(
|
||||
tap(
|
||||
() => this._notify(this._getMessage('remove', removeFromDictionary)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('remove', removeFromDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
@ -249,7 +249,7 @@ export class ManualAnnotationService {
|
||||
tap(
|
||||
() =>
|
||||
this._notify(this._getMessage('request-remove', removeFromDictionary)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('request-remove', removeFromDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
@ -292,7 +292,7 @@ export class ManualAnnotationService {
|
||||
.pipe(
|
||||
tap(
|
||||
() => this._notify(this._getMessage('suggest', false)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('suggest', false, true),
|
||||
NotificationType.ERROR,
|
||||
@ -312,7 +312,7 @@ export class ManualAnnotationService {
|
||||
.pipe(
|
||||
tap(
|
||||
() => this._notify(this._getMessage('add', false)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('add', false, true),
|
||||
NotificationType.ERROR,
|
||||
@ -335,7 +335,7 @@ export class ManualAnnotationService {
|
||||
this._notify(
|
||||
this._getMessage('suggest', manualRedactionEntry.addToDictionary)
|
||||
),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('suggest', manualRedactionEntry.addToDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
@ -356,7 +356,7 @@ export class ManualAnnotationService {
|
||||
tap(
|
||||
() =>
|
||||
this._notify(this._getMessage('add', manualRedactionEntry.addToDictionary)),
|
||||
(error) =>
|
||||
error =>
|
||||
this._notify(
|
||||
this._getMessage('add', manualRedactionEntry.addToDictionary, true),
|
||||
NotificationType.ERROR,
|
||||
|
||||
@ -58,7 +58,7 @@ export class PdfViewerDataService {
|
||||
redactionChangeLogObs,
|
||||
manualRedactionsObs,
|
||||
viewedPagesObs
|
||||
]).pipe(map((data) => new FileDataModel(this._appStateService.activeFile, ...data)));
|
||||
]).pipe(map(data => new FileDataModel(this._appStateService.activeFile, ...data)));
|
||||
}
|
||||
|
||||
getViewedPagesForActiveFile() {
|
||||
|
||||
@ -38,7 +38,7 @@ export abstract class BaseListingComponent<T = any> {
|
||||
get hasActiveFilters() {
|
||||
return (
|
||||
this._filterComponents
|
||||
.filter((f) => !!f)
|
||||
.filter(f => !!f)
|
||||
.reduce((prev, component) => prev || component?.hasActiveFilters, false) ||
|
||||
this.searchForm.get('query').value
|
||||
);
|
||||
@ -106,7 +106,7 @@ export abstract class BaseListingComponent<T = any> {
|
||||
}
|
||||
|
||||
resetFilters() {
|
||||
for (const filterComponent of this._filterComponents.filter((f) => !!f)) {
|
||||
for (const filterComponent of this._filterComponents.filter(f => !!f)) {
|
||||
filterComponent.deactivateAllFilters();
|
||||
}
|
||||
this.filtersChanged();
|
||||
@ -130,7 +130,7 @@ export abstract class BaseListingComponent<T = any> {
|
||||
this.selectedEntitiesIds = [];
|
||||
} else {
|
||||
this.selectedEntitiesIds = this.displayedEntities.map(
|
||||
(entity) => entity[this._getSelectionKey]
|
||||
entity => entity[this._getSelectionKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -161,7 +161,7 @@ export abstract class BaseListingComponent<T = any> {
|
||||
protected _executeSearchImmediately() {
|
||||
this.displayedEntities = (
|
||||
this._filters.length ? this.filteredEntities : this.allEntities
|
||||
).filter((entity) =>
|
||||
).filter(entity =>
|
||||
this._searchField(entity)
|
||||
.toLowerCase()
|
||||
.includes(this.searchForm.get('query').value.toLowerCase())
|
||||
@ -172,8 +172,8 @@ export abstract class BaseListingComponent<T = any> {
|
||||
protected _updateSelection() {
|
||||
if (this._selectionKey) {
|
||||
this.selectedEntitiesIds = this.displayedEntities
|
||||
.map((entity) => entity[this._getSelectionKey])
|
||||
.filter((id) => this.selectedEntitiesIds.includes(id));
|
||||
.map(entity => entity[this._getSelectionKey])
|
||||
.filter(id => this.selectedEntitiesIds.includes(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,11 +62,11 @@ export class FilterComponent implements OnChanges {
|
||||
ngOnChanges(): void {
|
||||
this.atLeastOneFilterIsExpandable = false;
|
||||
this.atLeastOneSecondaryFilterIsExpandable = false;
|
||||
this.primaryFilters?.forEach((f) => {
|
||||
this.primaryFilters?.forEach(f => {
|
||||
this.atLeastOneFilterIsExpandable =
|
||||
this.atLeastOneFilterIsExpandable || this.isExpandable(f);
|
||||
});
|
||||
this.secondaryFilters?.forEach((f) => {
|
||||
this.secondaryFilters?.forEach(f => {
|
||||
this.atLeastOneSecondaryFilterIsExpandable =
|
||||
this.atLeastOneSecondaryFilterIsExpandable || this.isExpandable(f);
|
||||
});
|
||||
@ -83,7 +83,7 @@ export class FilterComponent implements OnChanges {
|
||||
filter.checked = false;
|
||||
}
|
||||
filter.indeterminate = false;
|
||||
filter.filters?.forEach((f) => (f.checked = filter.checked));
|
||||
filter.filters?.forEach(f => (f.checked = filter.checked));
|
||||
}
|
||||
this._changeDetectorRef.detectChanges();
|
||||
this.applyFilters();
|
||||
@ -133,10 +133,10 @@ export class FilterComponent implements OnChanges {
|
||||
|
||||
private _setAllFilters(value: boolean) {
|
||||
const filters = value ? this.primaryFilters : this._allFilters;
|
||||
filters.forEach((f) => {
|
||||
filters.forEach(f => {
|
||||
f.checked = value;
|
||||
f.indeterminate = false;
|
||||
f.filters?.forEach((ff) => {
|
||||
f.filters?.forEach(ff => {
|
||||
ff.checked = value;
|
||||
});
|
||||
});
|
||||
|
||||
@ -6,7 +6,7 @@ import { PermissionsService } from '@services/permissions.service';
|
||||
export function processFilters(oldFilters: FilterModel[], newFilters: FilterModel[]) {
|
||||
copySettings(oldFilters, newFilters);
|
||||
if (newFilters) {
|
||||
newFilters.forEach((filter) => {
|
||||
newFilters.forEach(filter => {
|
||||
handleCheckedValue(filter);
|
||||
});
|
||||
}
|
||||
@ -20,17 +20,15 @@ export function handleFilterDelta(
|
||||
) {
|
||||
const newFiltersDelta = {};
|
||||
for (const newFilter of newFilters) {
|
||||
const oldFilter = oldFilters.find((f) => f.key === newFilter.key);
|
||||
const oldFilter = oldFilters.find(f => f.key === newFilter.key);
|
||||
if (!oldFilter || oldFilter.matches !== newFilter.matches) {
|
||||
newFiltersDelta[newFilter.key] = {};
|
||||
newFilter.filters.forEach(
|
||||
(filter) => (newFiltersDelta[newFilter.key][filter.key] = {})
|
||||
);
|
||||
newFilter.filters.forEach(filter => (newFiltersDelta[newFilter.key][filter.key] = {}));
|
||||
}
|
||||
|
||||
if (!oldFilter) {
|
||||
for (const childFilter of newFilter.filters) {
|
||||
const oldFilterChild = oldFilter?.filters.find((f) => f.key === childFilter.key);
|
||||
const oldFilterChild = oldFilter?.filters.find(f => f.key === childFilter.key);
|
||||
if (!oldFilterChild || oldFilterChild.matches !== childFilter.matches) {
|
||||
if (!newFiltersDelta[newFilter.key]) {
|
||||
newFiltersDelta[newFilter.key] = {};
|
||||
@ -42,14 +40,14 @@ export function handleFilterDelta(
|
||||
}
|
||||
|
||||
for (const key of Object.keys(newFiltersDelta)) {
|
||||
const foundFilter = allFilters.find((f) => f.key === key);
|
||||
const foundFilter = allFilters.find(f => f.key === key);
|
||||
if (foundFilter) {
|
||||
// if has children
|
||||
if (!foundFilter.filters?.length) {
|
||||
foundFilter.checked = true;
|
||||
} else {
|
||||
for (const subKey of Object.keys(newFiltersDelta[key])) {
|
||||
const childFilter = foundFilter.filters.find((f) => f.key === subKey);
|
||||
const childFilter = foundFilter.filters.find(f => f.key === subKey);
|
||||
if (childFilter) {
|
||||
childFilter.checked = true;
|
||||
}
|
||||
@ -57,7 +55,7 @@ export function handleFilterDelta(
|
||||
}
|
||||
}
|
||||
}
|
||||
allFilters.forEach((filter) => {
|
||||
allFilters.forEach(filter => {
|
||||
handleCheckedValue(filter);
|
||||
});
|
||||
}
|
||||
@ -65,7 +63,7 @@ export function handleFilterDelta(
|
||||
function copySettings(oldFilters: FilterModel[], newFilters: FilterModel[]) {
|
||||
if (oldFilters && newFilters) {
|
||||
for (const oldFilter of oldFilters) {
|
||||
const newFilter = newFilters.find((f) => f.key === oldFilter.key);
|
||||
const newFilter = newFilters.find(f => f.key === oldFilter.key);
|
||||
if (newFilter) {
|
||||
newFilter.checked = oldFilter.checked;
|
||||
newFilter.indeterminate = oldFilter.indeterminate;
|
||||
@ -95,7 +93,7 @@ export function checkFilter(
|
||||
validateArgs: any = [],
|
||||
matchAll: boolean = false
|
||||
) {
|
||||
const hasChecked = filters.find((f) => f.checked);
|
||||
const hasChecked = filters.find(f => f.checked);
|
||||
|
||||
if (validateArgs) {
|
||||
if (!Array.isArray(validateArgs)) {
|
||||
|
||||
@ -76,9 +76,9 @@ export class InitialsAvatarComponent implements OnChanges {
|
||||
return this._userService
|
||||
.getName(this.user)
|
||||
.split(' ')
|
||||
.filter((value) => value !== ' ')
|
||||
.filter(value => value !== ' ')
|
||||
.filter((value, idx) => idx < 2)
|
||||
.map((str) => str[0])
|
||||
.map(str => str[0])
|
||||
.join('');
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@ export class SelectComponent implements AfterViewInit, ControlValueAccessor {
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this._selectChips(this._value);
|
||||
this.chipList.chipSelectionChanges.pipe(map((event) => event.source)).subscribe((chip) => {
|
||||
this.chipList.chipSelectionChanges.pipe(map(event => event.source)).subscribe(chip => {
|
||||
if (chip.selected) {
|
||||
this._value = [...this._value, chip.value];
|
||||
} else {
|
||||
this._value = this._value.filter((o) => o !== chip.value);
|
||||
this._value = this._value.filter(o => o !== chip.value);
|
||||
}
|
||||
|
||||
this._propagateChange(this._value);
|
||||
@ -66,20 +66,20 @@ export class SelectComponent implements AfterViewInit, ControlValueAccessor {
|
||||
|
||||
selectAll($event) {
|
||||
$event.stopPropagation();
|
||||
this.chipList.chips.forEach((chip) => chip.select());
|
||||
this.chipList.chips.forEach(chip => chip.select());
|
||||
}
|
||||
|
||||
deselectAll($event) {
|
||||
$event.stopPropagation();
|
||||
this.chipList.chips.forEach((chip) => chip.deselect());
|
||||
this.chipList.chips.forEach(chip => chip.deselect());
|
||||
}
|
||||
|
||||
private _selectChips(value: string[]): void {
|
||||
this.chipList.chips.forEach((chip) => chip.deselect());
|
||||
this.chipList.chips.forEach(chip => chip.deselect());
|
||||
|
||||
const chipsToSelect = this.chipList.chips.filter((c) => value.includes(c.value));
|
||||
const chipsToSelect = this.chipList.chips.filter(c => value.includes(c.value));
|
||||
|
||||
chipsToSelect.forEach((chip) => chip.select());
|
||||
chipsToSelect.forEach(chip => chip.select());
|
||||
}
|
||||
|
||||
private _propagateChange(value: string[]): void {
|
||||
|
||||
@ -48,7 +48,7 @@ export class SimpleDoughnutChartComponent implements OnChanges {
|
||||
}
|
||||
|
||||
get dataTotal() {
|
||||
return this.config.map((v) => v.value).reduce((acc, val) => acc + val, 0);
|
||||
return this.config.map(v => v.value).reduce((acc, val) => acc + val, 0);
|
||||
}
|
||||
|
||||
get displayedDataTotal() {
|
||||
@ -60,16 +60,16 @@ export class SimpleDoughnutChartComponent implements OnChanges {
|
||||
this.cx = this.radius + this.strokeWidth / 2;
|
||||
this.cy = this.radius + this.strokeWidth / 2;
|
||||
this.size = this.strokeWidth + this.radius * 2;
|
||||
this.parsedConfig = this.config.map((el) => ({
|
||||
this.parsedConfig = this.config.map(el => ({
|
||||
...el,
|
||||
checked: this.filter?.find((f) => f.key === el.key)?.checked
|
||||
checked: this.filter?.find(f => f.key === el.key)?.checked
|
||||
}));
|
||||
}
|
||||
|
||||
calculateChartData() {
|
||||
const newData = [];
|
||||
let angleOffset = -90;
|
||||
this.config.forEach((dataVal) => {
|
||||
this.config.forEach(dataVal => {
|
||||
if (dataVal.value > 0) {
|
||||
const data = {
|
||||
degrees: angleOffset
|
||||
|
||||
@ -26,12 +26,12 @@ export class DictionarySaveService {
|
||||
showToast = true
|
||||
): Observable<any> {
|
||||
let entriesToAdd = [];
|
||||
entries.forEach((currentEntry) => {
|
||||
entries.forEach(currentEntry => {
|
||||
entriesToAdd.push(currentEntry);
|
||||
});
|
||||
// remove empty lines
|
||||
entriesToAdd = entriesToAdd.filter((e) => e && e.trim().length > 0).map((e) => e.trim());
|
||||
const invalidRowsExist = entriesToAdd.filter((e) => e.length < MIN_WORD_LENGTH);
|
||||
entriesToAdd = entriesToAdd.filter(e => e && e.trim().length > 0).map(e => e.trim());
|
||||
const invalidRowsExist = entriesToAdd.filter(e => e.length < MIN_WORD_LENGTH);
|
||||
if (invalidRowsExist.length === 0) {
|
||||
// can add at least 1 - block UI
|
||||
let obs: Observable<any>;
|
||||
|
||||
@ -40,7 +40,7 @@ export class FileDownloadService {
|
||||
): Observable<any> {
|
||||
return this._downloadControllerService
|
||||
.prepareDownload({
|
||||
fileIds: fileStatusWrappers.map((f) => f.fileId),
|
||||
fileIds: fileStatusWrappers.map(f => f.fileId),
|
||||
dossierId: dossier.dossierId
|
||||
})
|
||||
.pipe(mergeMap(() => this.getDownloadStatus()));
|
||||
@ -48,13 +48,11 @@ export class FileDownloadService {
|
||||
|
||||
getDownloadStatus() {
|
||||
return this._downloadControllerService.getDownloadStatus().pipe(
|
||||
tap((statusResponse) => {
|
||||
tap(statusResponse => {
|
||||
this.downloads = statusResponse.downloadStatus.map(
|
||||
(d) => new DownloadStatusWrapper(d)
|
||||
);
|
||||
this.hasPendingDownloads = !!this.downloads.find(
|
||||
(f) => !f.lastDownload && f.isReady
|
||||
d => new DownloadStatusWrapper(d)
|
||||
);
|
||||
this.hasPendingDownloads = !!this.downloads.find(f => !f.lastDownload && f.isReady);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ export class FileDropOverlayService {
|
||||
});
|
||||
}
|
||||
|
||||
dragListener = (e) => {
|
||||
dragListener = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (this._mouseIn) {
|
||||
@ -23,13 +23,13 @@ export class FileDropOverlayService {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
mouseIn = (e) => {
|
||||
mouseIn = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this._mouseIn = true;
|
||||
return false;
|
||||
};
|
||||
mouseOut = (e) => {
|
||||
mouseOut = e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (e.toElement == null && e.relatedTarget == null) {
|
||||
|
||||
@ -39,7 +39,7 @@ export class FileUploadService {
|
||||
|
||||
get activeDossierKeys() {
|
||||
return Object.keys(this.groupedFiles).filter(
|
||||
(dossierId) => this.groupedFiles[dossierId].length > 0
|
||||
dossierId => this.groupedFiles[dossierId].length > 0
|
||||
);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ export class FileUploadService {
|
||||
for (let idx = 0; idx < files.length; ++idx) {
|
||||
const file = files[idx];
|
||||
let currentOption = option;
|
||||
if (dossierFiles.find((pf) => pf.filename === file.file.name)) {
|
||||
if (dossierFiles.find(pf => pf.filename === file.file.name)) {
|
||||
if (!option) {
|
||||
const res = await this._dialogService.openOverwriteFileDialog(file.file.name);
|
||||
if (res.cancel) {
|
||||
@ -87,7 +87,7 @@ export class FileUploadService {
|
||||
}
|
||||
}
|
||||
this.files.push(...files);
|
||||
files.forEach((newFile) => {
|
||||
files.forEach(newFile => {
|
||||
this._addFileToGroup(newFile);
|
||||
this.scheduleUpload(newFile);
|
||||
});
|
||||
@ -160,7 +160,7 @@ export class FileUploadService {
|
||||
true
|
||||
);
|
||||
const subscription = obs.subscribe(
|
||||
async (event) => {
|
||||
async event => {
|
||||
if (event.type === HttpEventType.UploadProgress) {
|
||||
uploadFile.progress = Math.round(
|
||||
(event.loaded / (event.total || event.loaded)) * 100
|
||||
@ -197,7 +197,7 @@ export class FileUploadService {
|
||||
}
|
||||
|
||||
private _removeUpload(fileUploadModel: FileUploadModel) {
|
||||
const index = this._activeUploads.findIndex((au) => au.fileUploadModel === fileUploadModel);
|
||||
const index = this._activeUploads.findIndex(au => au.fileUploadModel === fileUploadModel);
|
||||
if (index > -1) {
|
||||
const subscription = this._activeUploads[index].subscription;
|
||||
if (subscription) {
|
||||
|
||||
@ -23,6 +23,6 @@ export class UploadDownloadDialogService {
|
||||
return ref
|
||||
.afterClosed()
|
||||
.toPromise()
|
||||
.then((res) => res || { cancel: true });
|
||||
.then(res => res || { cancel: true });
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export class ToastAction {
|
||||
})
|
||||
export class NotificationService {
|
||||
constructor(private readonly _toastr: ToastrService, private readonly _router: Router) {
|
||||
_router.events.subscribe((event) => {
|
||||
_router.events.subscribe(event => {
|
||||
if (event instanceof NavigationStart) {
|
||||
this._toastr.clear();
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ export class PermissionsService {
|
||||
}
|
||||
return (
|
||||
this.isApprover(dossier) &&
|
||||
dossier.files.filter((file) => this.fileRequiresReanalysis(file)).length > 0
|
||||
dossier.files.filter(file => this.fileRequiresReanalysis(file)).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ export class RouterHistoryService {
|
||||
|
||||
constructor(private readonly _router: Router) {
|
||||
this._router.events
|
||||
.pipe(filter((event) => event instanceof NavigationEnd))
|
||||
.pipe(filter(event => event instanceof NavigationEnd))
|
||||
.subscribe((event: NavigationEnd) => {
|
||||
if (event.url.startsWith('/main/dossiers')) {
|
||||
this._lastDossiersScreen = event.url;
|
||||
|
||||
@ -9,11 +9,11 @@ export class TranslateChartService {
|
||||
constructor(private readonly _translateService: TranslateService) {}
|
||||
|
||||
translateStatus(config: DoughnutChartConfig[]): DoughnutChartConfig[] {
|
||||
return config.map((val) => ({ ...val, label: this._translateService.instant(val.label) }));
|
||||
return config.map(val => ({ ...val, label: this._translateService.instant(val.label) }));
|
||||
}
|
||||
|
||||
translateRoles(config: DoughnutChartConfig[]): DoughnutChartConfig[] {
|
||||
return config.map((val) => ({
|
||||
return config.map(val => ({
|
||||
...val,
|
||||
label: this._translateService.instant(`roles.${val.label}`).toLowerCase()
|
||||
}));
|
||||
|
||||
@ -71,12 +71,12 @@ export class UserService {
|
||||
}
|
||||
|
||||
get managerUsers(): User[] {
|
||||
return this._allUsers.filter((u) => u.roles.indexOf('RED_MANAGER') >= 0);
|
||||
return this._allUsers.filter(u => u.roles.indexOf('RED_MANAGER') >= 0);
|
||||
}
|
||||
|
||||
get eligibleUsers(): User[] {
|
||||
return this._allUsers.filter(
|
||||
(u) => u.roles.indexOf('RED_USER') >= 0 || u.roles.indexOf('RED_MANAGER') >= 0
|
||||
u => u.roles.indexOf('RED_USER') >= 0 || u.roles.indexOf('RED_MANAGER') >= 0
|
||||
);
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ export class UserService {
|
||||
|
||||
async loadAllUsers() {
|
||||
const allUsers = await this._userControllerService.getUsers().toPromise();
|
||||
this._allUsers = allUsers.filter((u) => this._hasAnyRedRole(u));
|
||||
this._allUsers = allUsers.filter(u => this._hasAnyRedRole(u));
|
||||
return allUsers;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
getUserById(id: string) {
|
||||
return this._allUsers.find((u) => u.userId === id);
|
||||
return this._allUsers.find(u => u.userId === id);
|
||||
}
|
||||
|
||||
getNameForId(userId: string) {
|
||||
|
||||
@ -89,7 +89,7 @@ export class AppStateService {
|
||||
|
||||
get aggregatedFiles(): FileStatusWrapper[] {
|
||||
const result: FileStatusWrapper[] = [];
|
||||
this._appState.dossiers.forEach((p) => {
|
||||
this._appState.dossiers.forEach(p => {
|
||||
result.push(...p.files);
|
||||
});
|
||||
return result;
|
||||
@ -128,7 +128,7 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
get activeDossier(): DossierWrapper {
|
||||
return this._appState.dossiers.find((p) => p.dossierId === this.activeDossierId);
|
||||
return this._appState.dossiers.find(p => p.dossierId === this.activeDossierId);
|
||||
}
|
||||
|
||||
get allDossiers(): DossierWrapper[] {
|
||||
@ -140,7 +140,7 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
get activeFile(): FileStatusWrapper {
|
||||
return this.activeDossier?.files.find((f) => f.fileId === this.activeFileId);
|
||||
return this.activeDossier?.files.find(f => f.fileId === this.activeFileId);
|
||||
}
|
||||
|
||||
get activeFileId(): string {
|
||||
@ -207,7 +207,7 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
getDossierTemplateById(id: string): DossierTemplateModelWrapper {
|
||||
return this.dossierTemplates.find((rs) => rs.dossierTemplateId === id);
|
||||
return this.dossierTemplates.find(rs => rs.dossierTemplateId === id);
|
||||
}
|
||||
|
||||
getDictionaryTypeValue(key: string, dossierTemplateId?: string) {
|
||||
@ -230,26 +230,26 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
getDossierById(id: string) {
|
||||
return this.allDossiers.find((dossier) => dossier.dossier.dossierId === id);
|
||||
return this.allDossiers.find(dossier => dossier.dossier.dossierId === id);
|
||||
}
|
||||
|
||||
getFileById(dossierId: string, fileId: string) {
|
||||
return this.getDossierById(dossierId).files.find((file) => file.fileId === fileId);
|
||||
return this.getDossierById(dossierId).files.find(file => file.fileId === fileId);
|
||||
}
|
||||
|
||||
async loadAllDossiers(emitEvents: boolean = true) {
|
||||
const dossiers = await this._dossierControllerService.getDossiers().toPromise();
|
||||
if (dossiers) {
|
||||
const mappedDossiers = dossiers.map(
|
||||
(p) => new DossierWrapper(p, this._getExistingFiles(p.dossierId))
|
||||
p => new DossierWrapper(p, this._getExistingFiles(p.dossierId))
|
||||
);
|
||||
|
||||
const fileData = await this._statusControllerService
|
||||
.getFileStatusForDossiers(mappedDossiers.map((p) => p.dossierId))
|
||||
.getFileStatusForDossiers(mappedDossiers.map(p => p.dossierId))
|
||||
.toPromise();
|
||||
|
||||
for (const dossierId of Object.keys(fileData)) {
|
||||
const dossier = mappedDossiers.find((p) => p.dossierId === dossierId);
|
||||
const dossier = mappedDossiers.find(p => p.dossierId === dossierId);
|
||||
this._processFiles(dossier, fileData[dossierId], emitEvents);
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ export class AppStateService {
|
||||
this.activeDossier.dossierTemplateId,
|
||||
this._appState.fileAttributesConfig[this.activeDossier.dossierTemplateId]
|
||||
);
|
||||
this.activeDossier.files = this.activeDossier.files.map((file) =>
|
||||
this.activeDossier.files = this.activeDossier.files.map(file =>
|
||||
file.fileId === activeFileWrapper.fileId ? activeFileWrapper : file
|
||||
);
|
||||
|
||||
@ -320,7 +320,7 @@ export class AppStateService {
|
||||
this._dictionaryControllerService
|
||||
.getDictionaryForType(dossierTemplateId, 'dossier_redaction', dossierId)
|
||||
.subscribe(
|
||||
(typeData) => {
|
||||
typeData => {
|
||||
this.activeDossier.type = typeData;
|
||||
},
|
||||
() => {
|
||||
@ -378,7 +378,7 @@ export class AppStateService {
|
||||
.then(
|
||||
() => {
|
||||
const index = this._appState.dossiers.findIndex(
|
||||
(p) => p.dossier.dossierId === dossier.dossierId
|
||||
p => p.dossier.dossierId === dossier.dossierId
|
||||
);
|
||||
this._appState.dossiers.splice(index, 1);
|
||||
this._appState.dossiers = [...this._appState.dossiers];
|
||||
@ -399,7 +399,7 @@ export class AppStateService {
|
||||
.createOrUpdateDossier(dossier)
|
||||
.toPromise();
|
||||
let foundDossier = this._appState.dossiers.find(
|
||||
(p) => p.dossier.dossierId === updatedDossier.dossierId
|
||||
p => p.dossier.dossierId === updatedDossier.dossierId
|
||||
);
|
||||
if (foundDossier) {
|
||||
Object.assign((foundDossier.dossier = updatedDossier));
|
||||
@ -433,7 +433,7 @@ export class AppStateService {
|
||||
.getAllDossierTemplates1()
|
||||
.toPromise();
|
||||
this._appState.dossierTemplates = dossierTemplates.map(
|
||||
(dossierTemplate) => new DossierTemplateModelWrapper(dossierTemplate)
|
||||
dossierTemplate => new DossierTemplateModelWrapper(dossierTemplate)
|
||||
);
|
||||
this._appState.fileAttributesConfig = {};
|
||||
for (const dossierTemplate of this._appState.dossierTemplates) {
|
||||
@ -470,7 +470,7 @@ export class AppStateService {
|
||||
dictionaryData: { [key: string]: any }
|
||||
): Observable<any>[] {
|
||||
const typeObs = this._dictionaryControllerService.getAllTypes(dossierTemplateId).pipe(
|
||||
tap((typesResponse) => {
|
||||
tap(typesResponse => {
|
||||
for (const type of typesResponse.types) {
|
||||
dictionaryData[type.type] = type;
|
||||
dictionaryData[type.type].label = humanize(type.type, false);
|
||||
@ -479,7 +479,7 @@ export class AppStateService {
|
||||
);
|
||||
|
||||
const colorsObs = this._dictionaryControllerService.getColors(dossierTemplateId).pipe(
|
||||
tap((colors) => {
|
||||
tap(colors => {
|
||||
// declined
|
||||
dictionaryData['declined-suggestion'] = new TypeValueWrapper(
|
||||
{
|
||||
@ -682,7 +682,7 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
private _getExistingFiles(dossierId: string) {
|
||||
const found = this._appState.dossiers.find((p) => p.dossier.dossierId === dossierId);
|
||||
const found = this._appState.dossiers.find(p => p.dossier.dossierId === dossierId);
|
||||
return found ? found.files : [];
|
||||
}
|
||||
|
||||
@ -730,7 +730,7 @@ export class AppStateService {
|
||||
}
|
||||
|
||||
dossier.files = files.map(
|
||||
(f) =>
|
||||
f =>
|
||||
new FileStatusWrapper(
|
||||
f,
|
||||
this._userService.getNameForId(f.currentReviewer),
|
||||
@ -741,8 +741,8 @@ export class AppStateService {
|
||||
this._computeStats();
|
||||
|
||||
if (emitEvents) {
|
||||
fileReanalysedEvent.forEach((file) => this.fileReanalysed.emit(file));
|
||||
fileStatusChangedEvent.forEach((file) => this.fileChanged.emit(file));
|
||||
fileReanalysedEvent.forEach(file => this.fileReanalysed.emit(file));
|
||||
fileStatusChangedEvent.forEach(file => this.fileChanged.emit(file));
|
||||
}
|
||||
|
||||
return files;
|
||||
@ -752,13 +752,13 @@ export class AppStateService {
|
||||
let totalAnalysedPages = 0;
|
||||
let totalDocuments = 0;
|
||||
const totalPeople = new Set<string>();
|
||||
this._appState.dossiers.forEach((p) => {
|
||||
this._appState.dossiers.forEach(p => {
|
||||
totalDocuments += p.files.length;
|
||||
if (p.dossier.memberIds) {
|
||||
p.dossier.memberIds.forEach((m) => totalPeople.add(m));
|
||||
p.dossier.memberIds.forEach(m => totalPeople.add(m));
|
||||
}
|
||||
let numberOfPages = 0;
|
||||
p.files.forEach((f) => {
|
||||
p.files.forEach(f => {
|
||||
numberOfPages += f.numberOfPages;
|
||||
});
|
||||
p.totalNumberOfPages = numberOfPages;
|
||||
|
||||
@ -21,14 +21,6 @@ export class DossierWrapper {
|
||||
|
||||
private _files: FileStatusWrapper[];
|
||||
|
||||
get hasMoreThanOneApprover() {
|
||||
return this.approverIds.length > 1;
|
||||
}
|
||||
|
||||
get hasMoreThanOneReviewer() {
|
||||
return this.memberIds.length > 1;
|
||||
}
|
||||
|
||||
get files() {
|
||||
return this._files;
|
||||
}
|
||||
@ -38,6 +30,14 @@ export class DossierWrapper {
|
||||
this._recomputeFileStatus();
|
||||
}
|
||||
|
||||
get hasMoreThanOneApprover() {
|
||||
return this.approverIds.length > 1;
|
||||
}
|
||||
|
||||
get hasMoreThanOneReviewer() {
|
||||
return this.memberIds.length > 1;
|
||||
}
|
||||
|
||||
get dossierName() {
|
||||
return this.dossier.dossierName;
|
||||
}
|
||||
@ -91,7 +91,7 @@ export class DossierWrapper {
|
||||
}
|
||||
|
||||
hasStatus(status: string) {
|
||||
return this._files.find((f) => f.status === status);
|
||||
return this._files.find(f => f.status === status);
|
||||
}
|
||||
|
||||
hasMember(key: string) {
|
||||
@ -114,7 +114,7 @@ export class DossierWrapper {
|
||||
this.allFilesApproved = true;
|
||||
this.totalNumberOfPages = 0;
|
||||
this.hasPendingOrProcessing = false;
|
||||
this._files.forEach((f) => {
|
||||
this._files.forEach(f => {
|
||||
this.hintsOnly = this.hintsOnly || f.hintsOnly;
|
||||
this.hasRedactions = this.hasRedactions || f.hasRedactions;
|
||||
this.hasRequests = this.hasRequests || f.hasRequests;
|
||||
|
||||
@ -63,7 +63,7 @@ export class CustomRouteReuseStrategy implements RouteReuseStrategy {
|
||||
.map((el: ActivatedRouteSnapshot) =>
|
||||
el.routeConfig ? el.routeConfig.path + JSON.stringify(el.params) : ''
|
||||
)
|
||||
.filter((str) => str.length > 0)
|
||||
.filter(str => str.length > 0)
|
||||
.join('');
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ export function convertFiles(files: FileList | File[], dossier: DossierWrapper):
|
||||
}
|
||||
|
||||
uploadFiles = uploadFiles.filter(
|
||||
(file) =>
|
||||
file =>
|
||||
file.file.type?.toLowerCase() === 'application/pdf' ||
|
||||
file.file.name.toLowerCase().endsWith('.pdf') ||
|
||||
file.file.type?.toLowerCase() === 'application/zip' ||
|
||||
|
||||
@ -48,7 +48,7 @@ export function getFirstRelevantTextPart(text, direction: 'FORWARD' | 'BACKWARD'
|
||||
let accumulator = '';
|
||||
const breakChars = ['/', ':', ' '];
|
||||
|
||||
const handle = (i) => {
|
||||
const handle = i => {
|
||||
const char = text[i];
|
||||
if (breakChars.indexOf(char) >= 0) {
|
||||
spaceCount += 1;
|
||||
|
||||
@ -10,7 +10,7 @@ export function syncScroll(elements: HTMLElement[]) {
|
||||
|
||||
loopElement.eX = loopElement.eY = 0;
|
||||
|
||||
((el) => {
|
||||
(el => {
|
||||
el['addEventListener'](
|
||||
'scroll',
|
||||
(el.scrollSync = () => {
|
||||
|
||||
@ -704,7 +704,7 @@
|
||||
},
|
||||
"compare": {
|
||||
"compare": "Vergleichen Sie",
|
||||
"select-dossier-template": "Wählen Sie Dossiervorlage",
|
||||
"select-dossier": "Wählen Sie Dossiervorlage",
|
||||
"select-dictionary": "Wählen Sie Wörterbuch"
|
||||
},
|
||||
"select-dictionary": "Wählen Sie oben ein Wörterbuch aus, um es mit dem aktuellen zu vergleichen."
|
||||
|
||||
@ -745,8 +745,7 @@
|
||||
},
|
||||
"compare": {
|
||||
"compare": "Compare",
|
||||
"select-dossier-template": "Select Dossier Template",
|
||||
"select-dictionary": "Select Dictionary"
|
||||
"select-dossier": "Select Dossier"
|
||||
},
|
||||
"select-dictionary": "Select a dictionary above to compare with the current one."
|
||||
},
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="analyse" stroke="none" stroke-width="1">
|
||||
<path
|
||||
d="M16.5,89 L16.5,100 L0,100 L0,89 L16.5,89 Z M44.5,89 L44.5,100 L28,100 L28,89 L44.5,89 Z M72,89 L72,100 L55.5,100 L55.5,89 L72,89 Z M100,89 L100,100 L83.5,100 L83.5,89 L100,89 Z M16.5,66.5 L16.5,77.5 L0,77.5 L0,66.5 L16.5,66.5 Z M44.5,66.5 L44.5,77.5 L28,77.5 L28,66.5 L44.5,66.5 Z M72,66.5 L72,77.5 L55.5,77.5 L55.5,66.5 L72,66.5 Z M100,66.5 L100,77.5 L83.5,77.5 L83.5,66.5 L100,66.5 Z M16.5,44.5 L16.5,55.5 L0,55.5 L0,44.5 L16.5,44.5 Z M44.5,44.5 L44.5,55.5 L28,55.5 L28,44.5 L44.5,44.5 Z M100,44.5 L100,55.5 L83.5,55.5 L83.5,44.5 L100,44.5 Z M44.5,22 L44.5,33 L28,33 L28,22 L44.5,22 Z M100,22 L100,33 L83.5,33 L83.5,22 L100,22 Z M44.5,0 L44.5,11 L28,11 L28,0 L44.5,0 Z"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="Styleguide" stroke="none" stroke-width="1">
|
||||
<g fill="currentColor" fill-rule="nonzero" id="Styleguide-Actions"
|
||||
transform="translate(-62.000000, -567.000000)">
|
||||
|
||||
|
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 957 B |
@ -1,8 +1,8 @@
|
||||
<svg
|
||||
width="24"
|
||||
fill="none"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
width="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
@ -10,9 +10,9 @@
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M19.7782 19.7782C15.4824 24.0739 8.51759 24.0739 4.22183 19.7782C-0.0739417 15.4824 -0.0739417 8.51759 4.22183 4.22183C8.51759 -0.0739419 15.4824 -0.0739419 19.7782 4.22183C24.0739 8.51759 24.0739 15.4824 19.7782 19.7782ZM18.364 18.364C14.8492 21.8787 9.15076 21.8787 5.63604 18.364C2.12132 14.8492 2.12132 9.15076 5.63604 5.63604C9.15076 2.12132 14.8492 2.12132 18.364 5.63604C21.8787 9.15076 21.8787 14.8492 18.364 18.364Z"
|
||||
fill="currentColor"
|
||||
fill-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 841 B |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="Styleguide" stroke="none" stroke-width="1">
|
||||
<g id="Styleguide-Buttons" transform="translate(-469.000000, -757.000000)">
|
||||
<rect height="906" width="904" x="0" y="0"></rect>
|
||||
|
||||
|
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 678 B |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="right_expandable" stroke="none" stroke-width="1">
|
||||
<polygon fill="currentColor" id="Fill-1"
|
||||
points="7 9 10 5 4 5"
|
||||
|
||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 465 B |
@ -1,10 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<rect height="50" id="path-1" width="1440" x="0" y="61"></rect>
|
||||
<filter filterUnits="objectBoundingBox" height="128.0%" id="filter-2" width="101.0%" x="-0.5%" y="-10.0%">
|
||||
<filter filterUnits="objectBoundingBox" height="128.0%" id="filter-2" width="101.0%"
|
||||
x="-0.5%" y="-10.0%">
|
||||
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="2"></feGaussianBlur>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1"
|
||||
stdDeviation="2"></feGaussianBlur>
|
||||
<feColorMatrix in="shadowBlurOuter1"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.88627451 0 0 0 0 0.894117647 0 0 0 0 0.91372549 0 0 0 1 0"></feColorMatrix>
|
||||
@ -13,7 +16,8 @@
|
||||
<g fill="none" fill-rule="evenodd" id="Assignee" stroke="none" stroke-width="1">
|
||||
<g id="01.-Unassigned" transform="translate(-1066.000000, -79.000000)">
|
||||
<g id="Header-Document">
|
||||
<g fill="currentColor" fill-rule="nonzero" id="Group-13" transform="translate(917.000000, 69.000000)">
|
||||
<g fill="currentColor" fill-rule="nonzero" id="Group-13"
|
||||
transform="translate(917.000000, 69.000000)">
|
||||
<g id="Group-6" transform="translate(139.000000, 0.000000)">
|
||||
<g id="status" transform="translate(10.000000, 10.000000)">
|
||||
<path
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="assign" stroke="none" stroke-width="1">
|
||||
<path
|
||||
d="M35,50 C54.5,50 70,65.5 70,85 L70,85 L70,100 L0,100 L0,85 C0,65.5 15.5,50 35,50 Z M35,60 C21,60 10,71 10,85 L10,85 L10,90 L60,90 L60,85 C60,71 49,60 35,60 Z M35,5 C46,5 55,14 55,25 C55,36 46,45 35,45 C24,45 15,36 15,25 C15,14 24,5 35,5 Z M85,0 L85,15 L100,15 L100,25 L85,25 L85,40 L75,40 L75,25 L60,25 L60,15 L75,15 L75,0 L85,0 Z M35,15 C29.5,15 25,19.5 25,25 C25,30.5 29.5,35 35,35 C40.5,35 45,30.5 45,25 C45,19.5 40.5,15 35,15 Z"
|
||||
|
||||
|
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 790 B |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="Styleguide" stroke="none" stroke-width="1">
|
||||
<g fill="currentColor" fill-rule="nonzero" id="Styleguide-Actions"
|
||||
transform="translate(-608.000000, -651.000000)">
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="none" fill-rule="evenodd" id="calendar" stroke="none" stroke-width="1">
|
||||
<path
|
||||
d="M35,70 L35,80 L25,80 L25,70 L35,70 Z M55,70 L55,80 L45,80 L45,70 L55,70 Z M35,55 L35,65 L25,65 L25,55 L35,55 Z M55,55 L55,65 L45,65 L45,55 L55,55 Z M75,55 L75,65 L65,65 L65,55 L75,55 Z M55,40 L55,50 L45,50 L45,40 L55,40 Z M75,40 L75,50 L65,50 L65,40 L75,40 Z"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |