diff --git a/.eslintrc.json b/.eslintrc.json index ed5192ec9..8d6e81f2e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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", diff --git a/.prettierrc b/.prettierrc index 6a8dd18db..b79d43aad 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,6 +4,7 @@ "tabWidth": 4, "singleQuote": true, "trailingComma": "none", + "arrowParens": "avoid", "overrides": [ { "files": "{apps}/**/*.html", diff --git a/apps/red-ui/src/app/app-routing.module.ts b/apps/red-ui/src/app/app-routing.module.ts index 58c9b621d..016bece60 100644 --- a/apps/red-ui/src/app/app-routing.module.ts +++ b/apps/red-ui/src/app/app-routing.module.ts @@ -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', diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 1ca904ec7..a4dd18cad 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -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') || diff --git a/apps/red-ui/src/app/components/notifications/notifications.component.ts b/apps/red-ui/src/app/components/notifications/notifications.component.ts index 337e1cdc2..bc00b2827 100644 --- a/apps/red-ui/src/app/components/notifications/notifications.component.ts +++ b/apps/red-ui/src/app/components/notifications/notifications.component.ts @@ -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 { diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 6d9018db4..20ae8e150 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -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; } diff --git a/apps/red-ui/src/app/models/file/file-status.wrapper.ts b/apps/red-ui/src/app/models/file/file-status.wrapper.ts index d763f1944..f3c722b20 100644 --- a/apps/red-ui/src/app/models/file/file-status.wrapper.ts +++ b/apps/red-ui/src/app/models/file/file-status.wrapper.ts @@ -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]; diff --git a/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts index d75ad8de5..5b4da3e15 100644 --- a/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts @@ -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); diff --git a/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts index 83c3a6dc2..1108d7d7e 100644 --- a/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts @@ -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; } diff --git a/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.ts b/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.ts index 9c91c0d22..4136e2197 100644 --- a/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/dossier-template-actions/dossier-template-actions.component.ts @@ -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(); } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts index 1a81e9849..e435c3a0f 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts @@ -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) { diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.ts index 190133776..e60398154 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.ts @@ -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; } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts index 17fa94f0d..90a57469f 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.ts @@ -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(); diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.ts index eb3b95816..0f48fea5c 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.ts @@ -21,7 +21,7 @@ export class ConfirmDeleteUsersDialogComponent { private readonly _appStateService: AppStateService, public dialogRef: MatDialogRef ) { - 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; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts index d763d57aa..54533b1cf 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts @@ -43,16 +43,16 @@ export class ActiveFieldsListingComponent extends BaseListingComponent 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; } } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts index 4efcc313e..216610086 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.ts @@ -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 = 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); } diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts index 19a29640f..bc2fde0ea 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts @@ -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([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; diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index 738ee0761..371f7e7cc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -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] })); diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index 9ba5b1024..785ac34b8 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -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(() => { diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html index baba8c085..be552ccfa 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html @@ -63,10 +63,10 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts index 1d514c920..6625e9a75 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts @@ -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' }) diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts index 261f8caa0..1832c4977 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts @@ -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; }, diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts index 7ca63e92c..670ba052d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.ts @@ -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; diff --git a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts index 13653695f..7dbf54d26 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts @@ -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 = diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html index 44fc56498..cef6a100c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html @@ -21,9 +21,9 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts index e8806a54e..1e7af3e05 100644 --- a/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts @@ -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 { 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(); }, diff --git a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts index 09f82b5ae..774714b83 100644 --- a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.ts @@ -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() { diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts index 76274e4e9..0c4e8cc6f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts @@ -42,7 +42,7 @@ export class UserListingScreenComponent extends BaseListingComponent 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 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 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 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 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) ); } } diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts index 8a1bd4f07..24f0bbaa5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts @@ -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' }); }); diff --git a/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts index b5083acca..bcb8823ef 100644 --- a/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts @@ -61,7 +61,7 @@ export class AdminDialogService { ): MatDialogRef { $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 { $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); } diff --git a/apps/red-ui/src/app/modules/app-config/app-config.service.ts b/apps/red-ui/src/app/modules/app-config/app-config.service.ts index f9452d13f..1c4c52df6 100644 --- a/apps/red-ui/src/app/modules/app-config/app-config.service.ts +++ b/apps/red-ui/src/app/modules/app-config/app-config.service.ts @@ -42,10 +42,14 @@ export class AppConfigService { private readonly _titleService: Title ) {} + get version(): string { + return packageInfo.version; + } + loadAppConfig(): Observable { 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('/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; - } } diff --git a/apps/red-ui/src/app/modules/auth/red-role.guard.ts b/apps/red-ui/src/app/modules/auth/red-role.guard.ts index 5fcf390a7..5935ff6f6 100644 --- a/apps/red-ui/src/app/modules/auth/red-role.guard.ts +++ b/apps/red-ui/src/app/modules/auth/red-role.guard.ts @@ -15,7 +15,7 @@ export class RedRoleGuard implements CanActivate { ) {} canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - return new Observable((obs) => { + return new Observable(obs => { if (!this._userService.user.hasAnyREDRoles) { this._router.navigate(['/auth-error']); this._appLoadStateService.pushLoadingEvent(false); diff --git a/apps/red-ui/src/app/modules/dossier/components/annotation-remove-actions/annotation-remove-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/annotation-remove-actions/annotation-remove-actions.component.ts index 897641459..582da0c09 100644 --- a/apps/red-ui/src/app/modules/dossier/components/annotation-remove-actions/annotation-remove-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/annotation-remove-actions/annotation-remove-actions.component.ts @@ -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(); } diff --git a/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.html index a1f8f4a46..3e4fac23f 100644 --- a/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.html @@ -10,8 +10,8 @@ @@ -43,8 +43,8 @@ diff --git a/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.ts index d3b1ca069..f754bfb77 100644 --- a/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/bulk-actions/dossier-overview-bulk-actions.component.ts @@ -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) { - 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) { + this.loading = true; + obs.subscribe().add(() => { + this.reload.emit(); + this.loading = false; + }); + } } diff --git a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts index 7dd82fc20..25b7fe9b9 100644 --- a/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/comments/comments.component.ts @@ -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, diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html index 578f47291..f7d5e3bd4 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.html @@ -122,9 +122,9 @@
{{ 'dossier-overview.dossier-details.dictionary' | translate }} diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts index f9f2061de..d557f7046 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-details/dossier-details.component.ts @@ -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); } diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html index 8b5896cda..6cb4e7741 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.html @@ -28,8 +28,8 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.ts index 80df84c54..d72b26b1d 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-actions/dossier-listing-actions.component.ts @@ -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 })); } } diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.ts b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.ts index 90c29627b..b57f2b1b5 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.ts @@ -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); } diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html index 9346ea6d7..328ae5050 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html @@ -31,26 +31,26 @@ 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) { diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts index 7529fa3b6..2fa425525 100644 --- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts @@ -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) { diff --git a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html b/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html index 0e14b3070..39835bbe9 100644 --- a/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/scroll-button/scroll-button.component.html @@ -1,3 +1,3 @@ - diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts index 3676101f9..ff746d625 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/team-members-manager/team-members-manager.component.ts @@ -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); } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts index 261d2188a..25d79c42c 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts @@ -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); diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts index 9f8a11da4..0d00c4344 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.ts @@ -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 ) diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.ts index 7a615df32..b6ff867e3 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/document-info-dialog/document-info-dialog.component.ts @@ -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, diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component.html index f3888fe6b..2dac9745f 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/dossier-dictionary-dialog/dossier-dictionary-dialog.component.html @@ -5,9 +5,9 @@
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts index 95a26ab46..75e75cfce 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.ts @@ -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 { diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts index fb8d040dd..ec64d7538 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.ts @@ -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; } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts index 960f56e7b..8b905a9a1 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts @@ -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, diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 59f1322ee..086f02eb3 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -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) ); diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html index c7454a395..75f56b59b 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.html @@ -171,9 +171,9 @@
@@ -182,8 +182,8 @@ (filtersChanged)="filtersChanged($event)" *ngIf="allEntities.length" [documentsChartData]="documentsChartData" - [filters]="detailsContainerFilters" [dossiersChartData]="dossiersChartData" + [filters]="detailsContainerFilters" > diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts index d8d39a534..7266b22e4 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-listing-screen/dossier-listing-screen.component.ts @@ -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(); const allDistinctNeedsWork = new Set(); const allDistinctDossierTemplates = new Set(); - 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 diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html index 9b4ae3b10..b841aba1f 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.html @@ -56,8 +56,8 @@ @@ -311,9 +311,9 @@ diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts index 8f95eb31a..63bb47685 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview-screen/dossier-overview-screen.component.ts @@ -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(); // 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) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index 1259783a1..bc013adf2 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -118,8 +118,8 @@ permissionsService.canAssignUser() && appStateService.activeFile.currentReviewer " - icon="red:edit" [tooltip]="assignTooltip" + icon="red:edit" tooltipPosition="below" > diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 57366f03c..a3977530e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -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 () 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); }); } diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts index efd9c82eb..1d5461d71 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-actions.service.ts @@ -27,7 +27,7 @@ export class AnnotationActionsService { annotationsChanged: EventEmitter ) { $event?.stopPropagation(); - annotations.forEach((annotation) => { + annotations.forEach(annotation => { this._processObsAndEmit( this._manualAnnotationService.approveRequest( annotation.id, @@ -45,7 +45,7 @@ export class AnnotationActionsService { annotationsChanged: EventEmitter ) { $event?.stopPropagation(); - annotations.forEach((annotation) => { + annotations.forEach(annotation => { this._processObsAndEmit( this._manualAnnotationService.declineOrRemoveRequest(annotation), annotation, @@ -60,8 +60,8 @@ export class AnnotationActionsService { annotationsChanged: EventEmitter ) { $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 ) { - 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[] { const availableActions = []; - const annotationPermissions = annotations.map((a) => ({ + const annotationPermissions = annotations.map(a => ({ annotation: a, permissions: AnnotationPermissions.forUser( this._permissionsService.isApprover(), diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts index deceb9999..70009633f 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-draw.service.ts @@ -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( diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts index 9e02bd836..93a435402 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts @@ -24,7 +24,7 @@ export class AnnotationProcessingService { const filterMap = new Map(); 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 = ( diff --git a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts index a5cfb4139..5305b42bf 100644 --- a/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/dossiers-dialog.service.ts @@ -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) diff --git a/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts b/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts index f149ba1e8..ac1c86e57 100644 --- a/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts @@ -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 ) diff --git a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts index d7e6ddb81..4302b925d 100644 --- a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts @@ -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, diff --git a/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts b/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts index fc6796ee9..1bc61ed9c 100644 --- a/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/pdf-viewer-data.service.ts @@ -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() { diff --git a/apps/red-ui/src/app/modules/shared/base/base-listing.component.ts b/apps/red-ui/src/app/modules/shared/base/base-listing.component.ts index 773384350..f70aa9be1 100644 --- a/apps/red-ui/src/app/modules/shared/base/base-listing.component.ts +++ b/apps/red-ui/src/app/modules/shared/base/base-listing.component.ts @@ -38,7 +38,7 @@ export abstract class BaseListingComponent { 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 { } 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 { this.selectedEntitiesIds = []; } else { this.selectedEntitiesIds = this.displayedEntities.map( - (entity) => entity[this._getSelectionKey] + entity => entity[this._getSelectionKey] ); } } @@ -161,7 +161,7 @@ export abstract class BaseListingComponent { 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 { 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)); } } diff --git a/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts index 448882d57..2659b84f5 100644 --- a/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts @@ -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; }); }); diff --git a/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts b/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts index 9e96ded21..1b66e8fac 100644 --- a/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts +++ b/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts @@ -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)) { diff --git a/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts index d81c0fdef..217215bf6 100644 --- a/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts @@ -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(''); } } diff --git a/apps/red-ui/src/app/modules/shared/components/select/select.component.ts b/apps/red-ui/src/app/modules/shared/components/select/select.component.ts index bedd23877..2ad05e879 100644 --- a/apps/red-ui/src/app/modules/shared/components/select/select.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/select/select.component.ts @@ -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 { diff --git a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts index ffab08918..006b752c8 100644 --- a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts @@ -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 diff --git a/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts b/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts index 80cdb1e5b..bee26770e 100644 --- a/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/dictionary-save.service.ts @@ -26,12 +26,12 @@ export class DictionarySaveService { showToast = true ): Observable { 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; diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts index a08c6d854..9b7287ad3 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts @@ -40,7 +40,7 @@ export class FileDownloadService { ): Observable { 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); }) ); } diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts index 849c0e596..35e02614d 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts @@ -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) { diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts index b028f1871..4d6945494 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts @@ -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) { diff --git a/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts b/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts index 705cd75ab..c797e32d0 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts @@ -23,6 +23,6 @@ export class UploadDownloadDialogService { return ref .afterClosed() .toPromise() - .then((res) => res || { cancel: true }); + .then(res => res || { cancel: true }); } } diff --git a/apps/red-ui/src/app/services/notification.service.ts b/apps/red-ui/src/app/services/notification.service.ts index b5f1fffe4..9431503f7 100644 --- a/apps/red-ui/src/app/services/notification.service.ts +++ b/apps/red-ui/src/app/services/notification.service.ts @@ -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(); } diff --git a/apps/red-ui/src/app/services/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts index 38a20316d..d2b04d61c 100644 --- a/apps/red-ui/src/app/services/permissions.service.ts +++ b/apps/red-ui/src/app/services/permissions.service.ts @@ -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 ); } diff --git a/apps/red-ui/src/app/services/router-history.service.ts b/apps/red-ui/src/app/services/router-history.service.ts index 383c71ec4..10ca5e383 100644 --- a/apps/red-ui/src/app/services/router-history.service.ts +++ b/apps/red-ui/src/app/services/router-history.service.ts @@ -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; diff --git a/apps/red-ui/src/app/services/translate-chart.service.ts b/apps/red-ui/src/app/services/translate-chart.service.ts index 94172a2b1..581b4a467 100644 --- a/apps/red-ui/src/app/services/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -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() })); diff --git a/apps/red-ui/src/app/services/user.service.ts b/apps/red-ui/src/app/services/user.service.ts index 27bc9295a..d746b0d9c 100644 --- a/apps/red-ui/src/app/services/user.service.ts +++ b/apps/red-ui/src/app/services/user.service.ts @@ -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) { diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 9bc3732cc..a2042ba35 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -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[] { 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(); - 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; diff --git a/apps/red-ui/src/app/state/model/dossier.wrapper.ts b/apps/red-ui/src/app/state/model/dossier.wrapper.ts index e3b8d6630..586211801 100644 --- a/apps/red-ui/src/app/state/model/dossier.wrapper.ts +++ b/apps/red-ui/src/app/state/model/dossier.wrapper.ts @@ -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; diff --git a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts index d3a1155d2..d44fe6a07 100644 --- a/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts +++ b/apps/red-ui/src/app/utils/custom-route-reuse.strategy.ts @@ -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(''); } diff --git a/apps/red-ui/src/app/utils/file-drop-utils.ts b/apps/red-ui/src/app/utils/file-drop-utils.ts index c33916885..1123dd446 100644 --- a/apps/red-ui/src/app/utils/file-drop-utils.ts +++ b/apps/red-ui/src/app/utils/file-drop-utils.ts @@ -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' || diff --git a/apps/red-ui/src/app/utils/functions.ts b/apps/red-ui/src/app/utils/functions.ts index 1efba9e23..e4f6d99b8 100644 --- a/apps/red-ui/src/app/utils/functions.ts +++ b/apps/red-ui/src/app/utils/functions.ts @@ -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; diff --git a/apps/red-ui/src/app/utils/sync-scroll.ts b/apps/red-ui/src/app/utils/sync-scroll.ts index 0a1c34e43..50e90757e 100644 --- a/apps/red-ui/src/app/utils/sync-scroll.ts +++ b/apps/red-ui/src/app/utils/sync-scroll.ts @@ -10,7 +10,7 @@ export function syncScroll(elements: HTMLElement[]) { loopElement.eX = loopElement.eY = 0; - ((el) => { + (el => { el['addEventListener']( 'scroll', (el.scrollSync = () => { diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index be1b0670e..798000c1f 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -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." diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 3e45174e1..0687bf90e 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -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." }, diff --git a/apps/red-ui/src/assets/icons/general/analyse.svg b/apps/red-ui/src/assets/icons/general/analyse.svg index cd30ad60e..9f087414c 100644 --- a/apps/red-ui/src/assets/icons/general/analyse.svg +++ b/apps/red-ui/src/assets/icons/general/analyse.svg @@ -1,5 +1,6 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/arrow-down-o.svg b/apps/red-ui/src/assets/icons/general/arrow-down-o.svg index 65c93afa2..384b3c98d 100644 --- a/apps/red-ui/src/assets/icons/general/arrow-down-o.svg +++ b/apps/red-ui/src/assets/icons/general/arrow-down-o.svg @@ -1,8 +1,8 @@ diff --git a/apps/red-ui/src/assets/icons/general/arrow-down.svg b/apps/red-ui/src/assets/icons/general/arrow-down.svg index 2ddf80100..2dc89f6d2 100644 --- a/apps/red-ui/src/assets/icons/general/arrow-down.svg +++ b/apps/red-ui/src/assets/icons/general/arrow-down.svg @@ -1,5 +1,6 @@ - + diff --git a/apps/red-ui/src/assets/icons/general/arrow-right.svg b/apps/red-ui/src/assets/icons/general/arrow-right.svg index 310d69820..a413e5866 100644 --- a/apps/red-ui/src/assets/icons/general/arrow-right.svg +++ b/apps/red-ui/src/assets/icons/general/arrow-right.svg @@ -1,5 +1,6 @@ - + - + - + - + @@ -13,7 +16,8 @@ - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/calendar.svg b/apps/red-ui/src/assets/icons/general/calendar.svg index b103404b1..7ec143f05 100644 --- a/apps/red-ui/src/assets/icons/general/calendar.svg +++ b/apps/red-ui/src/assets/icons/general/calendar.svg @@ -1,5 +1,6 @@ - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/check.svg b/apps/red-ui/src/assets/icons/general/check.svg index 655a17760..65f074eb0 100644 --- a/apps/red-ui/src/assets/icons/general/check.svg +++ b/apps/red-ui/src/assets/icons/general/check.svg @@ -1,4 +1,5 @@ - diff --git a/apps/red-ui/src/assets/icons/general/close.svg b/apps/red-ui/src/assets/icons/general/close.svg index ab8741da6..d12857ac2 100644 --- a/apps/red-ui/src/assets/icons/general/close.svg +++ b/apps/red-ui/src/assets/icons/general/close.svg @@ -1,5 +1,6 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/color-picker.svg b/apps/red-ui/src/assets/icons/general/color-picker.svg index fecf6cdaf..7c1574d55 100644 --- a/apps/red-ui/src/assets/icons/general/color-picker.svg +++ b/apps/red-ui/src/assets/icons/general/color-picker.svg @@ -1,4 +1,5 @@ - - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg b/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg index e747666fd..48b88b14f 100644 --- a/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg +++ b/apps/red-ui/src/assets/icons/general/exit-fullscreen.svg @@ -1,5 +1,6 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/folder.svg b/apps/red-ui/src/assets/icons/general/folder.svg index 545911e98..ff019f31d 100644 --- a/apps/red-ui/src/assets/icons/general/folder.svg +++ b/apps/red-ui/src/assets/icons/general/folder.svg @@ -1,5 +1,6 @@ - + - + - + - + - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/nav-last.svg b/apps/red-ui/src/assets/icons/general/nav-last.svg index f1bd73660..1f946a08d 100644 --- a/apps/red-ui/src/assets/icons/general/nav-last.svg +++ b/apps/red-ui/src/assets/icons/general/nav-last.svg @@ -1,5 +1,6 @@ - + diff --git a/apps/red-ui/src/assets/icons/general/nav-next.svg b/apps/red-ui/src/assets/icons/general/nav-next.svg index 258fe5ec3..66c58d679 100644 --- a/apps/red-ui/src/assets/icons/general/nav-next.svg +++ b/apps/red-ui/src/assets/icons/general/nav-next.svg @@ -1,5 +1,6 @@ - + @@ -7,7 +8,8 @@ - + diff --git a/apps/red-ui/src/assets/icons/general/nav-prev.svg b/apps/red-ui/src/assets/icons/general/nav-prev.svg index 8e43d9d0c..eed255cf3 100644 --- a/apps/red-ui/src/assets/icons/general/nav-prev.svg +++ b/apps/red-ui/src/assets/icons/general/nav-prev.svg @@ -1,5 +1,6 @@ - + @@ -7,7 +8,8 @@ - + - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/ocr.svg b/apps/red-ui/src/assets/icons/general/ocr.svg index 351e8e09c..c6ef773d1 100644 --- a/apps/red-ui/src/assets/icons/general/ocr.svg +++ b/apps/red-ui/src/assets/icons/general/ocr.svg @@ -1,5 +1,6 @@ - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/pages.svg b/apps/red-ui/src/assets/icons/general/pages.svg index b11d6abfa..ca053988b 100644 --- a/apps/red-ui/src/assets/icons/general/pages.svg +++ b/apps/red-ui/src/assets/icons/general/pages.svg @@ -1,5 +1,6 @@ - + - + - + - + R diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg index 87bbb30b7..4b0c4221d 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg @@ -1,4 +1,5 @@ - diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg index cc1d40227..d1b44c2d3 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-search.svg @@ -1,5 +1,6 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/preview.svg b/apps/red-ui/src/assets/icons/general/preview.svg index 532cf42f6..39f5ec7da 100644 --- a/apps/red-ui/src/assets/icons/general/preview.svg +++ b/apps/red-ui/src/assets/icons/general/preview.svg @@ -3,7 +3,8 @@ > - + diff --git a/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg b/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg index 7a75a84f7..35c8b8249 100644 --- a/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg +++ b/apps/red-ui/src/assets/icons/general/radio-indeterminate.svg @@ -1,10 +1,12 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/radio-selected.svg b/apps/red-ui/src/assets/icons/general/radio-selected.svg index bba849899..cfef08cf4 100644 --- a/apps/red-ui/src/assets/icons/general/radio-selected.svg +++ b/apps/red-ui/src/assets/icons/general/radio-selected.svg @@ -1,5 +1,6 @@ - + diff --git a/apps/red-ui/src/assets/icons/general/read-only.svg b/apps/red-ui/src/assets/icons/general/read-only.svg index 3f70a5e2b..fa85e29f6 100644 --- a/apps/red-ui/src/assets/icons/general/read-only.svg +++ b/apps/red-ui/src/assets/icons/general/read-only.svg @@ -1,10 +1,12 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/ready-for-approval.svg b/apps/red-ui/src/assets/icons/general/ready-for-approval.svg index 6e59d0567..85a642090 100644 --- a/apps/red-ui/src/assets/icons/general/ready-for-approval.svg +++ b/apps/red-ui/src/assets/icons/general/ready-for-approval.svg @@ -1,5 +1,6 @@ - + - + - + - + - diff --git a/apps/red-ui/src/assets/icons/general/status-collapse.svg b/apps/red-ui/src/assets/icons/general/status-collapse.svg index 5397c078d..24559afe8 100644 --- a/apps/red-ui/src/assets/icons/general/status-collapse.svg +++ b/apps/red-ui/src/assets/icons/general/status-collapse.svg @@ -5,16 +5,20 @@ - - + + - + - + diff --git a/apps/red-ui/src/assets/icons/general/status-expand.svg b/apps/red-ui/src/assets/icons/general/status-expand.svg index 547100d52..b09e5dfe5 100644 --- a/apps/red-ui/src/assets/icons/general/status-expand.svg +++ b/apps/red-ui/src/assets/icons/general/status-expand.svg @@ -5,20 +5,25 @@ - - + + - + - + + font-weight="normal" id="Dossier-details" + transform="translate(1111.000000, 127.000000)"> diff --git a/apps/red-ui/src/assets/icons/general/status-info.svg b/apps/red-ui/src/assets/icons/general/status-info.svg index 4f1ec8bc5..4da6d9580 100644 --- a/apps/red-ui/src/assets/icons/general/status-info.svg +++ b/apps/red-ui/src/assets/icons/general/status-info.svg @@ -1,10 +1,13 @@ - + - + - + @@ -15,10 +18,12 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/status.svg b/apps/red-ui/src/assets/icons/general/status.svg index 2cfd29a02..ffd2808ab 100644 --- a/apps/red-ui/src/assets/icons/general/status.svg +++ b/apps/red-ui/src/assets/icons/general/status.svg @@ -1,5 +1,6 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/thumb_down.svg b/apps/red-ui/src/assets/icons/general/thumb_down.svg index 6aefdb656..30dc2d870 100644 --- a/apps/red-ui/src/assets/icons/general/thumb_down.svg +++ b/apps/red-ui/src/assets/icons/general/thumb_down.svg @@ -1,5 +1,6 @@ - + - + - + - + - + diff --git a/apps/red-ui/src/assets/icons/general/upload.svg b/apps/red-ui/src/assets/icons/general/upload.svg index e80e23b9e..31dfde2e2 100644 --- a/apps/red-ui/src/assets/icons/general/upload.svg +++ b/apps/red-ui/src/assets/icons/general/upload.svg @@ -1,5 +1,6 @@ - + - + { + .then(moduleRef => { if (!environment.production) { const applicationRef = moduleRef.injector.get(ApplicationRef); const componentRef = applicationRef.components[0]; @@ -19,4 +19,4 @@ platformBrowserDynamic() enableDebugTools(componentRef); } }) - .catch((err) => window['console'].error(err)); + .catch(err => window['console'].error(err)); diff --git a/libs/red-cache/jest.config.js b/libs/red-cache/jest.config.js index 85b3c04c9..2a387101b 100644 --- a/libs/red-cache/jest.config.js +++ b/libs/red-cache/jest.config.js @@ -4,7 +4,12 @@ module.exports = { globals: { 'ts-jest': { stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { before: ['jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer'] }, + astTransformers: { + before: [ + 'jest-preset-angular/build/InlineFilesTransformer', + 'jest-preset-angular/build/StripStylesTransformer' + ] + }, tsconfig: '/tsconfig.spec.json' } }, diff --git a/libs/red-cache/src/lib/caches/cache-api.service.ts b/libs/red-cache/src/lib/caches/cache-api.service.ts index 51f893359..f4a9b7524 100644 --- a/libs/red-cache/src/lib/caches/cache-api.service.ts +++ b/libs/red-cache/src/lib/caches/cache-api.service.ts @@ -18,7 +18,11 @@ export class CacheApiService { for (const dynCache of DYNAMIC_CACHES) { for (const cacheUrl of dynCache.urls) { if (url.indexOf(cacheUrl) >= 0) { - return caches.open(dynCache.name).then((cache) => this._handleFetchResponse(httpResponse, dynCache, cache, url)); + return caches + .open(dynCache.name) + .then(cache => + this._handleFetchResponse(httpResponse, dynCache, cache, url) + ); } } } @@ -29,7 +33,7 @@ export class CacheApiService { const url = this._buildUrl(request); return from(caches.match(url)).pipe( - mergeMap((response) => { + mergeMap(response => { if (response) { const expires = response.headers.get('_expires'); if (expires) { @@ -52,7 +56,7 @@ export class CacheApiService { cacheValue(name: string, valueReference: any, ttl = 3600): Promise { if (this.cachesAvailable) { - return caches.open(APP_LEVEL_CACHE).then((cache) => { + return caches.open(APP_LEVEL_CACHE).then(cache => { const string = JSON.stringify(valueReference); const expires = new Date().getTime() + ttl * 1000; const response = new Response(string, { @@ -71,14 +75,14 @@ export class CacheApiService { removeCache(cacheId: string): Promise { if (this.cachesAvailable) { - return caches.open(APP_LEVEL_CACHE).then((cache) => cache.delete(cacheId)); + return caches.open(APP_LEVEL_CACHE).then(cache => cache.delete(cacheId)); } else { return Promise.resolve(undefined); } } deleteDynamicCache(cacheName: string): Promise { - if (this.cachesAvailable && DYNAMIC_CACHES.some((cache) => cache.name === cacheName)) { + if (this.cachesAvailable && DYNAMIC_CACHES.some(cache => cache.name === cacheName)) { return caches.delete(cacheName); } else { return Promise.resolve(undefined); @@ -86,8 +90,8 @@ export class CacheApiService { } deleteDynamicCacheEntry(cacheName: string, cacheEntry: string): Promise { - if (this.cachesAvailable && DYNAMIC_CACHES.some((cache) => cache.name === cacheName)) { - return caches.open(cacheName).then((cache) => cache.delete(cacheEntry)); + if (this.cachesAvailable && DYNAMIC_CACHES.some(cache => cache.name === cacheName)) { + return caches.open(cacheName).then(cache => cache.delete(cacheEntry)); } else { return Promise.resolve(undefined); } @@ -95,8 +99,8 @@ export class CacheApiService { getCachedValue(name: string): Promise { if (this.cachesAvailable) { - return caches.open(APP_LEVEL_CACHE).then((cache) => - cache.match(name).then((result) => { + return caches.open(APP_LEVEL_CACHE).then(cache => + cache.match(name).then(result => { if (result) { const expires = result.headers.get('_expires'); try { @@ -182,7 +186,7 @@ export class CacheApiService { // console.log('[CACHE-API] content type', contentType, response.url); return obs.pipe( map( - (body) => + body => // console.log('[CACHE-API] BODY', body); new HttpResponse({ body, @@ -206,7 +210,7 @@ export class CacheApiService { } }; - httpResponse.headers.keys().forEach((key) => { + httpResponse.headers.keys().forEach(key => { cachedResponseFields.headers[key] = httpResponse.headers.get(key); }); cachedResponseFields.headers._expires = expires; @@ -230,13 +234,13 @@ export class CacheApiService { } private _handleCacheExpiration(dynCache, now) { - caches.open(dynCache.name).then((cache) => { - cache.keys().then((keys) => { + caches.open(dynCache.name).then(cache => { + cache.keys().then(keys => { // removed expired; for (let i = 0; i < keys.length; i++) { const key = keys[i]; // console.log('[CACHE-API] checking cache key: ', key); - cache.match(key).then((response) => { + cache.match(key).then(response => { const expires = response.headers.get('_expires'); try { if (parseInt(expires, 10) < now) { @@ -246,7 +250,7 @@ export class CacheApiService { }); } }); - cache.keys().then((keys) => { + cache.keys().then(keys => { if (keys.length > dynCache.maxSize) { const keysToRemove = keys.slice(0, keys.length - dynCache.maxSize); // console.log('[CACHE-API] cache to large - removing keys: ', keysToRemove); diff --git a/libs/red-cache/src/lib/caches/cache-utils.ts b/libs/red-cache/src/lib/caches/cache-utils.ts index 8536c612b..5a54c9be8 100644 --- a/libs/red-cache/src/lib/caches/cache-utils.ts +++ b/libs/red-cache/src/lib/caches/cache-utils.ts @@ -32,7 +32,7 @@ export async function wipeCaches(logoutDependant: boolean = false) { } export async function wipeCacheEntry(cacheName: string, entry: string) { - caches.open(cacheName).then((cache) => { + caches.open(cacheName).then(cache => { cache.delete(entry, { ignoreSearch: false }); }); } diff --git a/libs/red-cache/src/lib/caches/http-cache-interceptor.ts b/libs/red-cache/src/lib/caches/http-cache-interceptor.ts index 07779ebf2..e6119d29d 100644 --- a/libs/red-cache/src/lib/caches/http-cache-interceptor.ts +++ b/libs/red-cache/src/lib/caches/http-cache-interceptor.ts @@ -1,4 +1,10 @@ -import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; +import { + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, + HttpResponse +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { CacheApiService } from './cache-api.service'; @@ -32,7 +38,7 @@ export class HttpCacheInterceptor implements HttpInterceptor { sendRequest(request: HttpRequest, next: HttpHandler): Observable> { // console.log('[CACHE-API] request', request.url); return next.handle(request).pipe( - tap((event) => { + tap(event => { // There may be other events besides the response. if (event instanceof HttpResponse) { this._cacheApiService.cacheRequest(request, event); diff --git a/libs/red-cache/src/lib/caches/id-to-object-list-cache-store.service.ts b/libs/red-cache/src/lib/caches/id-to-object-list-cache-store.service.ts index 6f94a2726..809248dd2 100644 --- a/libs/red-cache/src/lib/caches/id-to-object-list-cache-store.service.ts +++ b/libs/red-cache/src/lib/caches/id-to-object-list-cache-store.service.ts @@ -25,7 +25,7 @@ export class IdToObjectListCacheStoreService { registerCache( name: string, cacheFunction: (ids: string[], ...params: any) => Observable<{ [key: string]: any }>, - keyConversionFunction: (id: string, ...params: any) => string = (id) => id + keyConversionFunction: (id: string, ...params: any) => string = id => id ) { this._cachesList[name] = { name, @@ -37,7 +37,7 @@ export class IdToObjectListCacheStoreService { invokeCache(name: string, ids: string[], ...params: any): Observable<{ [key: string]: any }> { const promises = []; const cache = this._cachesList[name]; - ids.map((id) => this._toUrl(name, cache.keyConversionFunction(id, params))).forEach((url) => { + ids.map(id => this._toUrl(name, cache.keyConversionFunction(id, params))).forEach(url => { promises.push(this._cacheApiService.getCachedValue(url)); }); return from(Promise.all(promises)) @@ -46,17 +46,17 @@ export class IdToObjectListCacheStoreService { mergeMap((resolvedValues: IdToObject[]) => { const partialResult = {}; resolvedValues - .filter((v) => !!v) - .forEach((foundValue) => { + .filter(v => !!v) + .forEach(foundValue => { partialResult[foundValue.id] = foundValue.object; }); const existingIds = Object.keys(partialResult); - const requestIds = ids.filter((el) => !existingIds.includes(el)); + const requestIds = ids.filter(el => !existingIds.includes(el)); if (requestIds.length > 0) { return cache.cacheFunction(requestIds, params).pipe( - map((data) => { + map(data => { // new items for (const key of Object.keys(data)) { const idToObject = { @@ -64,7 +64,10 @@ export class IdToObjectListCacheStoreService { object: data[key] }; // cache each new result - this._cacheApiService.cacheValue(this._toUrl(name, cache.keyConversionFunction(key, params)), idToObject); + this._cacheApiService.cacheValue( + this._toUrl(name, cache.keyConversionFunction(key, params)), + idToObject + ); } // add existing results to final result for (const existingKey of Object.keys(partialResult)) { diff --git a/libs/red-ui-http/jest.config.js b/libs/red-ui-http/jest.config.js index 9c85e3c8b..f2d44522e 100644 --- a/libs/red-ui-http/jest.config.js +++ b/libs/red-ui-http/jest.config.js @@ -4,7 +4,12 @@ module.exports = { globals: { 'ts-jest': { stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { before: ['jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer'] }, + astTransformers: { + before: [ + 'jest-preset-angular/build/InlineFilesTransformer', + 'jest-preset-angular/build/StripStylesTransformer' + ] + }, tsconfig: '/tsconfig.spec.json' } }, diff --git a/libs/red-ui-http/src/lib/api/auditController.service.ts b/libs/red-ui-http/src/lib/api/auditController.service.ts index 6171c2e78..149eca2c3 100644 --- a/libs/red-ui-http/src/lib/api/auditController.service.ts +++ b/libs/red-ui-http/src/lib/api/auditController.service.ts @@ -28,7 +28,11 @@ export class AuditControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -58,21 +62,37 @@ export class AuditControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAuditCategories(observe?: 'body', reportProgress?: boolean): Observable>; - public getAuditCategories(observe?: 'response', reportProgress?: boolean): Observable>>; - public getAuditCategories(observe?: 'events', reportProgress?: boolean): Observable>>; - public getAuditCategories(observe: any = 'body', reportProgress: boolean = false): Observable { + public getAuditCategories( + observe?: 'body', + reportProgress?: boolean + ): Observable>; + public getAuditCategories( + observe?: 'response', + reportProgress?: boolean + ): Observable>>; + public getAuditCategories( + observe?: 'events', + reportProgress?: boolean + ): Observable>>; + public getAuditCategories( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -80,12 +100,16 @@ export class AuditControllerService { // to determine the Content-Type header const consumes: string[] = []; - return this.httpClient.request>('get', `${this.basePath}/audit/categories`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request>( + 'get', + `${this.basePath}/audit/categories`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -95,32 +119,55 @@ export class AuditControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public searchAuditLog(body: AuditSearchRequest, observe?: 'body', reportProgress?: boolean): Observable; - public searchAuditLog(body: AuditSearchRequest, observe?: 'response', reportProgress?: boolean): Observable>; - public searchAuditLog(body: AuditSearchRequest, observe?: 'events', reportProgress?: boolean): Observable>; - public searchAuditLog(body: AuditSearchRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + public searchAuditLog( + body: AuditSearchRequest, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public searchAuditLog( + body: AuditSearchRequest, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public searchAuditLog( + body: AuditSearchRequest, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public searchAuditLog( + body: AuditSearchRequest, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling searchAuditLog.'); + throw new Error( + 'Required parameter body was null or undefined when calling searchAuditLog.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } diff --git a/libs/red-ui-http/src/lib/api/debugController.service.ts b/libs/red-ui-http/src/lib/api/debugController.service.ts index c75d6bae8..7b129a6bf 100644 --- a/libs/red-ui-http/src/lib/api/debugController.service.ts +++ b/libs/red-ui-http/src/lib/api/debugController.service.ts @@ -25,7 +25,11 @@ export class DebugControllerService { public configuration = new Configuration(); protected basePath = ''; - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -43,15 +47,37 @@ export class DebugControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugClassificationsForm( + file: Blob, + inline?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable; - public debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugClassificationsForm( + file: Blob, + inline?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>; - public debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugClassificationsForm( + file: Blob, + inline?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>; - public debugClassificationsForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public debugClassificationsForm( + file: Blob, + inline?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling debugClassifications.'); + throw new Error( + 'Required parameter file was null or undefined when calling debugClassifications.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -63,13 +89,17 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -113,15 +143,37 @@ export class DebugControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugHtmlTablesForm( + file: Blob, + inline?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable; - public debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugHtmlTablesForm( + file: Blob, + inline?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>; - public debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugHtmlTablesForm( + file: Blob, + inline?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>; - public debugHtmlTablesForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public debugHtmlTablesForm( + file: Blob, + inline?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling debugHtmlTables.'); + throw new Error( + 'Required parameter file was null or undefined when calling debugHtmlTables.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -133,13 +185,17 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -184,15 +240,37 @@ export class DebugControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public debugSectionsForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugSectionsForm( + file: Blob, + inline?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable; - public debugSectionsForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugSectionsForm( + file: Blob, + inline?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>; - public debugSectionsForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugSectionsForm( + file: Blob, + inline?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>; - public debugSectionsForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public debugSectionsForm( + file: Blob, + inline?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling debugSections.'); + throw new Error( + 'Required parameter file was null or undefined when calling debugSections.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -204,13 +282,17 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -255,15 +337,41 @@ export class DebugControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public redactionForm( + file: Blob, + inline?: boolean, + flatRedaction?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable; - public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public redactionForm( + file: Blob, + inline?: boolean, + flatRedaction?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>; - public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public redactionForm( + file: Blob, + inline?: boolean, + flatRedaction?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>; - public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public redactionForm( + file: Blob, + inline?: boolean, + flatRedaction?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling redaction.'); + throw new Error( + 'Required parameter file was null or undefined when calling redaction.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -278,13 +386,17 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } diff --git a/libs/red-ui-http/src/lib/api/downloadController.service.ts b/libs/red-ui-http/src/lib/api/downloadController.service.ts index 0d131912c..b34826c8f 100644 --- a/libs/red-ui-http/src/lib/api/downloadController.service.ts +++ b/libs/red-ui-http/src/lib/api/downloadController.service.ts @@ -29,7 +29,11 @@ export class DownloadControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -61,12 +65,34 @@ export class DownloadControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public downloadFile(storageId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; - public downloadFile(storageId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; - public downloadFile(storageId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; - public downloadFile(storageId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public downloadFile( + storageId: string, + inline?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public downloadFile( + storageId: string, + inline?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public downloadFile( + storageId: string, + inline?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public downloadFile( + storageId: string, + inline?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (storageId === null || storageId === undefined) { - throw new Error('Required parameter storageId was null or undefined when calling downloadFile.'); + throw new Error( + 'Required parameter storageId was null or undefined when calling downloadFile.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -80,13 +106,17 @@ export class DownloadControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -109,21 +139,37 @@ export class DownloadControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getDownloadStatus(observe?: 'body', reportProgress?: boolean): Observable; - public getDownloadStatus(observe?: 'response', reportProgress?: boolean): Observable>; - public getDownloadStatus(observe?: 'events', reportProgress?: boolean): Observable>; - public getDownloadStatus(observe: any = 'body', reportProgress: boolean = false): Observable { + public getDownloadStatus( + observe?: 'body', + reportProgress?: boolean + ): Observable; + public getDownloadStatus( + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public getDownloadStatus( + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public getDownloadStatus( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -131,12 +177,16 @@ export class DownloadControllerService { // to determine the Content-Type header const consumes: string[] = []; - return this.httpClient.request('get', `${this.basePath}/async/download/status`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'get', + `${this.basePath}/async/download/status`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -146,32 +196,55 @@ export class DownloadControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteDownload(body: RemoveDownloadRequest, observe?: 'body', reportProgress?: boolean): Observable; - public deleteDownload(body: RemoveDownloadRequest, observe?: 'response', reportProgress?: boolean): Observable>; - public deleteDownload(body: RemoveDownloadRequest, observe?: 'events', reportProgress?: boolean): Observable>; - public deleteDownload(body: RemoveDownloadRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + public deleteDownload( + body: RemoveDownloadRequest, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public deleteDownload( + body: RemoveDownloadRequest, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public deleteDownload( + body: RemoveDownloadRequest, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public deleteDownload( + body: RemoveDownloadRequest, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling prepareDownload.'); + throw new Error( + 'Required parameter body was null or undefined when calling prepareDownload.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } @@ -192,42 +265,69 @@ export class DownloadControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public prepareDownload(body: PrepareDownloadRequest, observe?: 'body', reportProgress?: boolean): Observable; - public prepareDownload(body: PrepareDownloadRequest, observe?: 'response', reportProgress?: boolean): Observable>; - public prepareDownload(body: PrepareDownloadRequest, observe?: 'events', reportProgress?: boolean): Observable>; - public prepareDownload(body: PrepareDownloadRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + public prepareDownload( + body: PrepareDownloadRequest, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public prepareDownload( + body: PrepareDownloadRequest, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public prepareDownload( + body: PrepareDownloadRequest, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public prepareDownload( + body: PrepareDownloadRequest, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling prepareDownload.'); + throw new Error( + 'Required parameter body was null or undefined when calling prepareDownload.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } - return this.httpClient.request('post', `${this.basePath}/async/download/prepare`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'post', + `${this.basePath}/async/download/prepare`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } } diff --git a/libs/red-ui-http/src/lib/api/infoController.service.ts b/libs/red-ui-http/src/lib/api/infoController.service.ts index 85727f960..03ceace03 100644 --- a/libs/red-ui-http/src/lib/api/infoController.service.ts +++ b/libs/red-ui-http/src/lib/api/infoController.service.ts @@ -26,7 +26,11 @@ export class InfoControllerService { public configuration = new Configuration(); protected basePath = ''; - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -44,22 +48,32 @@ export class InfoControllerService { */ public getAuthInfo(observe?: 'body', reportProgress?: boolean): Observable; - public getAuthInfo(observe?: 'response', reportProgress?: boolean): Observable>; + public getAuthInfo( + observe?: 'response', + reportProgress?: boolean + ): Observable>; - public getAuthInfo(observe?: 'events', reportProgress?: boolean): Observable>; + public getAuthInfo( + observe?: 'events', + reportProgress?: boolean + ): Observable>; public getAuthInfo(observe: any = 'body', reportProgress: boolean = false): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } diff --git a/libs/red-ui-http/src/lib/api/licenseReportController.service.ts b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts index f68355479..440132697 100644 --- a/libs/red-ui-http/src/lib/api/licenseReportController.service.ts +++ b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts @@ -28,7 +28,11 @@ export class LicenseReportControllerService { public configuration = new Configuration(); protected basePath = ''; - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -47,7 +51,13 @@ export class LicenseReportControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe?: 'body', reportProgress?: boolean): Observable; + public licenseReport( + body: LicenseReportRequest, + offset?: number, + limit?: number, + observe?: 'body', + reportProgress?: boolean + ): Observable; public licenseReport( body: LicenseReportRequest, @@ -65,9 +75,17 @@ export class LicenseReportControllerService { reportProgress?: boolean ): Observable>; - public licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe: any = 'body', reportProgress: boolean = false): Observable { + public licenseReport( + body: LicenseReportRequest, + offset?: number, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling licenseReport.'); + throw new Error( + 'Required parameter body was null or undefined when calling licenseReport.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -82,20 +100,25 @@ export class LicenseReportControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } diff --git a/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts b/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts index 0a71a5242..7ef49271f 100644 --- a/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts +++ b/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts @@ -27,7 +27,11 @@ export class SmtpConfigurationControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -58,20 +62,33 @@ export class SmtpConfigurationControllerService { * @param reportProgress flag to report request and response progress. */ public clearSMTPConfiguration(observe?: 'body', reportProgress?: boolean): Observable; - public clearSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - public clearSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - public clearSMTPConfiguration(observe: any = 'body', reportProgress: boolean = false): Observable { + public clearSMTPConfiguration( + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public clearSMTPConfiguration( + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public clearSMTPConfiguration( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -93,21 +110,37 @@ export class SmtpConfigurationControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getCurrentSMTPConfiguration(observe?: 'body', reportProgress?: boolean): Observable; - public getCurrentSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - public getCurrentSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - public getCurrentSMTPConfiguration(observe: any = 'body', reportProgress: boolean = false): Observable { + public getCurrentSMTPConfiguration( + observe?: 'body', + reportProgress?: boolean + ): Observable; + public getCurrentSMTPConfiguration( + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public getCurrentSMTPConfiguration( + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public getCurrentSMTPConfiguration( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -115,12 +148,16 @@ export class SmtpConfigurationControllerService { // to determine the Content-Type header const consumes: string[] = []; - return this.httpClient.request('get', `${this.basePath}/configuration/smtp`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'get', + `${this.basePath}/configuration/smtp`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -130,32 +167,55 @@ export class SmtpConfigurationControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public testSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'body', reportProgress?: boolean): Observable; - public testSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'response', reportProgress?: boolean): Observable>; - public testSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'events', reportProgress?: boolean): Observable>; - public testSMTPConfiguration(body: SMTPConfigurationModel, observe: any = 'body', reportProgress: boolean = false): Observable { + public testSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public testSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public testSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public testSMTPConfiguration( + body: SMTPConfigurationModel, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling testSMTPConfiguration.'); + throw new Error( + 'Required parameter body was null or undefined when calling testSMTPConfiguration.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } @@ -176,32 +236,55 @@ export class SmtpConfigurationControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'body', reportProgress?: boolean): Observable; - public updateSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'response', reportProgress?: boolean): Observable>; - public updateSMTPConfiguration(body: SMTPConfigurationModel, observe?: 'events', reportProgress?: boolean): Observable>; - public updateSMTPConfiguration(body: SMTPConfigurationModel, observe: any = 'body', reportProgress: boolean = false): Observable { + public updateSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public updateSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public updateSMTPConfiguration( + body: SMTPConfigurationModel, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public updateSMTPConfiguration( + body: SMTPConfigurationModel, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateSMTPConfiguration.'); + throw new Error( + 'Required parameter body was null or undefined when calling updateSMTPConfiguration.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } diff --git a/libs/red-ui-http/src/lib/api/userController.service.ts b/libs/red-ui-http/src/lib/api/userController.service.ts index f13035ee8..19b2e5adf 100644 --- a/libs/red-ui-http/src/lib/api/userController.service.ts +++ b/libs/red-ui-http/src/lib/api/userController.service.ts @@ -30,7 +30,11 @@ export class UserControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -62,47 +66,80 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public addRoleToUsers(body: Array, userId: string, observe?: 'body', reportProgress?: boolean): Observable; - public addRoleToUsers(body: Array, userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public addRoleToUsers(body: Array, userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public addRoleToUsers(body: Array, userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public addRoleToUsers( + body: Array, + userId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public addRoleToUsers( + body: Array, + userId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public addRoleToUsers( + body: Array, + userId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public addRoleToUsers( + body: Array, + userId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addRoleToUsers.'); + throw new Error( + 'Required parameter body was null or undefined when calling addRoleToUsers.' + ); } if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling addRoleToUsers.'); + throw new Error( + 'Required parameter userId was null or undefined when calling addRoleToUsers.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } - return this.httpClient.request('post', `${this.basePath}/user/${encodeURIComponent(String(userId))}/role`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'post', + `${this.basePath}/user/${encodeURIComponent(String(userId))}/role`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -112,32 +149,55 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUser(body: CreateUserRequest, observe?: 'body', reportProgress?: boolean): Observable; - public createUser(body: CreateUserRequest, observe?: 'response', reportProgress?: boolean): Observable>; - public createUser(body: CreateUserRequest, observe?: 'events', reportProgress?: boolean): Observable>; - public createUser(body: CreateUserRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + public createUser( + body: CreateUserRequest, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public createUser( + body: CreateUserRequest, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public createUser( + body: CreateUserRequest, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public createUser( + body: CreateUserRequest, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); + throw new Error( + 'Required parameter body was null or undefined when calling createUser.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } @@ -159,24 +219,42 @@ export class UserControllerService { * @param reportProgress flag to report request and response progress. */ public deleteUser(userId: string, observe?: 'body', reportProgress?: boolean): Observable; - public deleteUser(userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public deleteUser(userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public deleteUser(userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public deleteUser( + userId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public deleteUser( + userId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public deleteUser( + userId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling deleteUser.'); + throw new Error( + 'Required parameter userId was null or undefined when calling deleteUser.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -184,12 +262,16 @@ export class UserControllerService { // to determine the Content-Type header const consumes: string[] = []; - return this.httpClient.request('delete', `${this.basePath}/user/${encodeURIComponent(String(userId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'delete', + `${this.basePath}/user/${encodeURIComponent(String(userId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -199,17 +281,35 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUsers(userId: Array, observe?: 'body', reportProgress?: boolean): Observable; - public deleteUsers(userId: Array, observe?: 'response', reportProgress?: boolean): Observable>; - public deleteUsers(userId: Array, observe?: 'events', reportProgress?: boolean): Observable>; - public deleteUsers(userId: Array, observe: any = 'body', reportProgress: boolean = false): Observable { + public deleteUsers( + userId: Array, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public deleteUsers( + userId: Array, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public deleteUsers( + userId: Array, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public deleteUsers( + userId: Array, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling deleteUser1.'); + throw new Error( + 'Required parameter userId was null or undefined when calling deleteUser1.' + ); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (userId) { - userId.forEach((element) => { + userId.forEach(element => { queryParameters = queryParameters.append('userId', element); }); } @@ -218,13 +318,17 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -248,25 +352,47 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserById(userId: string, observe?: 'body', reportProgress?: boolean): Observable; - public getUserById(userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public getUserById(userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public getUserById(userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public getUserById( + userId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public getUserById( + userId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public getUserById( + userId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public getUserById( + userId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling getUserById.'); + throw new Error( + 'Required parameter userId was null or undefined when calling getUserById.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -274,12 +400,16 @@ export class UserControllerService { // to determine the Content-Type header const consumes: string[] = []; - return this.httpClient.request('get', `${this.basePath}/user/${encodeURIComponent(String(userId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'get', + `${this.basePath}/user/${encodeURIComponent(String(userId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -289,10 +419,26 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUsers(refreshCache?: boolean, observe?: 'body', reportProgress?: boolean): Observable>; - public getUsers(refreshCache?: boolean, observe?: 'response', reportProgress?: boolean): Observable>>; - public getUsers(refreshCache?: boolean, observe?: 'events', reportProgress?: boolean): Observable>>; - public getUsers(refreshCache?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public getUsers( + refreshCache?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable>; + public getUsers( + refreshCache?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>>; + public getUsers( + refreshCache?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>>; + public getUsers( + refreshCache?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (refreshCache !== undefined && refreshCache !== null) { queryParameters = queryParameters.set('refreshCache', refreshCache); @@ -302,13 +448,17 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -332,10 +482,26 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllUsers(refreshCache?: boolean, observe?: 'body', reportProgress?: boolean): Observable>; - public getAllUsers(refreshCache?: boolean, observe?: 'response', reportProgress?: boolean): Observable>>; - public getAllUsers(refreshCache?: boolean, observe?: 'events', reportProgress?: boolean): Observable>>; - public getAllUsers(refreshCache?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { + public getAllUsers( + refreshCache?: boolean, + observe?: 'body', + reportProgress?: boolean + ): Observable>; + public getAllUsers( + refreshCache?: boolean, + observe?: 'response', + reportProgress?: boolean + ): Observable>>; + public getAllUsers( + refreshCache?: boolean, + observe?: 'events', + reportProgress?: boolean + ): Observable>>; + public getAllUsers( + refreshCache?: boolean, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (refreshCache !== undefined && refreshCache !== null) { queryParameters = queryParameters.set('refreshCache', refreshCache); @@ -345,13 +511,17 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } @@ -375,32 +545,55 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'body', reportProgress?: boolean): Observable; - public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'response', reportProgress?: boolean): Observable>; - public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'events', reportProgress?: boolean): Observable>; - public updateMyProfile(body: UpdateMyProfileRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + public updateMyProfile( + body: UpdateMyProfileRequest, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public updateMyProfile( + body: UpdateMyProfileRequest, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public updateMyProfile( + body: UpdateMyProfileRequest, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public updateMyProfile( + body: UpdateMyProfileRequest, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateProfile.'); + throw new Error( + 'Required parameter body was null or undefined when calling updateProfile.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } @@ -422,46 +615,79 @@ export class UserControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'body', reportProgress?: boolean): Observable; - public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public updateProfile(body: UpdateProfileRequest, userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public updateProfile( + body: UpdateProfileRequest, + userId: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public updateProfile( + body: UpdateProfileRequest, + userId: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public updateProfile( + body: UpdateProfileRequest, + userId: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public updateProfile( + body: UpdateProfileRequest, + userId: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateProfile1.'); + throw new Error( + 'Required parameter body was null or undefined when calling updateProfile1.' + ); } if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling updateProfile1.'); + throw new Error( + 'Required parameter userId was null or undefined when calling updateProfile1.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } - return this.httpClient.request('post', `${this.basePath}/user/profile/${encodeURIComponent(String(userId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'post', + `${this.basePath}/user/profile/${encodeURIComponent(String(userId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } } diff --git a/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts b/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts index ce8bad7f3..2c818f3f8 100644 --- a/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts +++ b/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts @@ -24,7 +24,11 @@ export class UserPreferenceControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -55,35 +59,61 @@ export class UserPreferenceControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePreferences(key: string, observe?: 'body', reportProgress?: boolean): Observable; - public deletePreferences(key: string, observe?: 'response', reportProgress?: boolean): Observable>; - public deletePreferences(key: string, observe?: 'events', reportProgress?: boolean): Observable>; - public deletePreferences(key: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public deletePreferences( + key: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public deletePreferences( + key: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public deletePreferences( + key: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public deletePreferences( + key: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (key === null || key === undefined) { - throw new Error('Required parameter key was null or undefined when calling deletePreferences.'); + throw new Error( + 'Required parameter key was null or undefined when calling deletePreferences.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } - return this.httpClient.request('delete', `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'delete', + `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -92,31 +122,51 @@ export class UserPreferenceControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllUserAttributes(observe?: 'body', reportProgress?: boolean): Observable<{ [key: string]: Array }>; - public getAllUserAttributes(observe?: 'response', reportProgress?: boolean): Observable }>>; - public getAllUserAttributes(observe?: 'events', reportProgress?: boolean): Observable }>>; - public getAllUserAttributes(observe: any = 'body', reportProgress: boolean = false): Observable { + public getAllUserAttributes( + observe?: 'body', + reportProgress?: boolean + ): Observable<{ [key: string]: Array }>; + public getAllUserAttributes( + observe?: 'response', + reportProgress?: boolean + ): Observable }>>; + public getAllUserAttributes( + observe?: 'events', + reportProgress?: boolean + ): Observable }>>; + public getAllUserAttributes( + observe: any = 'body', + reportProgress: boolean = false + ): Observable { let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } - return this.httpClient.request<{ [key: string]: Array }>('get', `${this.basePath}/attributes`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request<{ [key: string]: Array }>( + 'get', + `${this.basePath}/attributes`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -127,46 +177,79 @@ export class UserPreferenceControllerService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public savePreferences(body: Array, key: string, observe?: 'body', reportProgress?: boolean): Observable; - public savePreferences(body: Array, key: string, observe?: 'response', reportProgress?: boolean): Observable>; - public savePreferences(body: Array, key: string, observe?: 'events', reportProgress?: boolean): Observable>; - public savePreferences(body: Array, key: string, observe: any = 'body', reportProgress: boolean = false): Observable { + public savePreferences( + body: Array, + key: string, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public savePreferences( + body: Array, + key: string, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public savePreferences( + body: Array, + key: string, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public savePreferences( + body: Array, + key: string, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling savePreferences.'); + throw new Error( + 'Required parameter body was null or undefined when calling savePreferences.' + ); } if (key === null || key === undefined) { - throw new Error('Required parameter key was null or undefined when calling savePreferences.'); + throw new Error( + 'Required parameter key was null or undefined when calling savePreferences.' + ); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + const accessToken = + typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + const httpHeaderAcceptSelected: string | undefined = + this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } - return this.httpClient.request('put', `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'put', + `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } } diff --git a/libs/red-ui-http/src/lib/api/versionsController.service.ts b/libs/red-ui-http/src/lib/api/versionsController.service.ts index 65fa2ddb1..82cd84800 100644 --- a/libs/red-ui-http/src/lib/api/versionsController.service.ts +++ b/libs/red-ui-http/src/lib/api/versionsController.service.ts @@ -167,7 +167,7 @@ export class VersionsControllerService { let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (dossierTemplateId) { - dossierTemplateId.forEach((element) => { + dossierTemplateId.forEach(element => { queryParameters = queryParameters.append('dossierTemplateId', element); }); } diff --git a/libs/red-ui-http/src/lib/configuration.ts b/libs/red-ui-http/src/lib/configuration.ts index 60a47cdb6..d43dea327 100644 --- a/libs/red-ui-http/src/lib/configuration.ts +++ b/libs/red-ui-http/src/lib/configuration.ts @@ -36,7 +36,7 @@ export class Configuration { return undefined; } - const type = contentTypes.find((x) => this.isJsonMime(x)); + const type = contentTypes.find(x => this.isJsonMime(x)); if (type === undefined) { return contentTypes[0]; } @@ -55,7 +55,7 @@ export class Configuration { return undefined; } - const type = accepts.find((x) => this.isJsonMime(x)); + const type = accepts.find(x => this.isJsonMime(x)); if (type === undefined) { return accepts[0]; }