From 73c6a67a25258eb832046f4d6a629ad16b1ce165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Sat, 17 Jul 2021 00:44:21 +0300 Subject: [PATCH 01/25] Translation rework: Table col name --- .../downloads-list-screen.component.html | 37 +- .../active-fields-listing.component.html | 13 +- .../screens/audit/audit-screen.component.html | 66 +- .../default-colors-screen.component.html | 25 +- .../dictionary-listing-screen.component.html | 41 +- ...r-attributes-listing-screen.component.html | 4 +- ...er-templates-listing-screen.component.html | 8 +- ...e-attributes-listing-screen.component.html | 14 +- .../user-listing-screen.component.html | 40 +- .../dossier-listing-screen.component.html | 15 +- .../dossier-overview-screen.component.html | 12 +- .../table-col-name.component.html | 15 +- apps/red-ui/src/assets/i18n/te.json | 872 ++++++++++++++++++ package-lock.json | 0 package.json | 5 + yarn.lock | 142 ++- 16 files changed, 1104 insertions(+), 205 deletions(-) create mode 100644 apps/red-ui/src/assets/i18n/te.json delete mode 100644 package-lock.json diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index 34990b3c9..604d6cc14 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -14,47 +14,26 @@
- {{ - 'downloads-list.table-header.title' - | translate: { length: fileDownloadService.downloads.length } - }} + {{ 'downloads-list.table-header.title' | translate: { length: fileDownloadService.downloads.length } }}
- - - - + + + +
- + -
+
-
+
{{ download.filename }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index a77d8178e..507db984c 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -56,21 +56,24 @@
- + - +
diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 9dafe7911..677820c46 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -22,10 +22,7 @@
- {{ - 'audit-screen.table-header.title' - | translate: { length: logs?.totalHits || 0 } - }} + {{ 'audit-screen.table-header.title' | translate: { length: logs?.totalHits || 0 } }}
- + {{ 'audit-screen.categories.' + category | translate }} @@ -56,10 +50,7 @@ [withName]="true" size="small" > -
+
-
+
ยท
- + - +
@@ -95,16 +76,9 @@
- + - +
@@ -114,30 +88,26 @@
- +
@@ -148,11 +118,7 @@ {{ log.recordDate | date: 'd MMM. yyyy, hh:mm a' }}
- +
@@ -163,6 +129,4 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html index a2c268aa8..2d0c03531 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html @@ -22,10 +22,7 @@
- {{ - 'default-colors-screen.table-header.title' - | translate: { length: (allEntities$ | async).length } - }} + {{ 'default-colors-screen.table-header.title' | translate: { length: (allEntities$ | async).length } }}
@@ -33,14 +30,14 @@
@@ -50,25 +47,15 @@
-
+
-
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index 13ac5fe9e..9d675e87c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -25,17 +25,12 @@
- {{ - 'dictionary-listing.table-header.title' - | translate: { length: (displayedEntities$ | async)?.length } - }} + {{ 'dictionary-listing.table-header.title' | translate: { length: (displayedEntities$ | async)?.length } }}
-
+
@@ -112,25 +103,16 @@
- +
-
+
{{ dict.label }} @@ -153,10 +135,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index 4269a49d2..ce510f9fe 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -64,17 +64,17 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index a2649fbed..d3c4909bd 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -64,27 +64,27 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index ab90c8b99..eca3d984e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -75,35 +75,37 @@ - +
diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index f83253c24..b678ecd32 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -38,28 +38,19 @@
- {{ - 'user-listing.table-header.title' - | translate: { length: (displayedEntities$ | async)?.length } - }} + {{ 'user-listing.table-header.title' | translate: { length: (displayedEntities$ | async)?.length } }}
- - - + + + - +
@@ -98,14 +83,9 @@ -
+
- +
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 9d2b61546..9f0381acf 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 @@ -20,16 +20,23 @@ - + - + + + -
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 a80cc7fc4..0dd5b045f 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 @@ -64,45 +64,45 @@ - +
diff --git a/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html index d34610c8a..df851184d 100644 --- a/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html +++ b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html @@ -1,17 +1,8 @@
- - -
+ {{ label }} + +
diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json new file mode 100644 index 000000000..83f2574bf --- /dev/null +++ b/apps/red-ui/src/assets/i18n/te.json @@ -0,0 +1,872 @@ +{ + "%0D%0A": "", + ", ": "", + "-owner": { + "dialog": { + "cancel": "", + "title": "" + } + }, + "": { + "": "", + "title": "" + }, + "actions": { + "all": "", + "none": "" + }, + "add-dossier-dialog": { + "actions": { + "save": "" + }, + "errors": { + "dossier-already-exists": "", + "generic": "" + }, + "form": { + "description": { + "label": "", + "placeholder": "" + }, + "due-date": "", + "name": { + "label": "", + "placeholder": "" + }, + "template": "", + "watermark": "" + }, + "header-new": "" + }, + "add-edit-dictionary": { + "form": { + "add-to-dictionary-action": "", + "case-sensitive": "", + "color": "", + "color-placeholder": "", + "description": "", + "description-placeholder": "", + "hint": "", + "name": "", + "name-hint": "", + "name-placeholder": "", + "rank": "", + "rank-placeholder": "", + "redaction": "" + }, + "save": "" + }, + "add-edit-dossier-attribute": { + "form": { + "label": "", + "label-placeholder": "", + "placeholder": "", + "type": "" + }, + "save": "", + "title": { + "edit": "", + "new": "" + } + }, + "add-edit-dossier-template": { + "form": { + "description": "", + "description-placeholder": "", + "name": "", + "name-placeholder": "", + "valid-from": "", + "valid-to": "" + }, + "save": "", + "title": { + "edit": "", + "new": "" + } + }, + "add-edit-file-attribute": { + "form": { + "column-header": "", + "column-header-placeholder": "", + "name": "", + "name-placeholder": "", + "primary": "", + "read-only": "", + "type": "" + }, + "save": "", + "title": { + "edit": "", + "new": "" + } + }, + "add-edit-user": { + "actions": { + "cancel": "", + "save": "", + "save-changes": "" + }, + "form": { + "email": "", + "first-name": "", + "last-name": "", + "reset-password": "", + "role": "" + }, + "title": { + "edit": "", + "new": "" + } + }, + "annotation": "", + "annotation-actions": { + "accept-recommendation": { + "label": "" + }, + "accept-suggestion": { + "label": "" + }, + "force-redaction": { + "label": "" + }, + "hide": "", + "recategorize-image": "", + "reject-suggestion": "", + "remove-annotation": { + "false-positive": "", + "only-here": "", + "remove-from-dict": "" + }, + "undo": "" + }, + "annotations": "", + "assign-": "", + "assign-dossier-owner": { + "dialog": { + "approvers": "", + "make-approver": "", + "no-approvers": "", + "no-reviewers": "", + "reviewers": "", + "single-user": "" + } + }, + "audit": "", + "audit-screen": { + "categories": { + "": "" + }, + "table-col-names": { + "category": "", + "date": "", + "message": "", + "user": "" + }, + "table-header": { + "title": "" + }, + "to": "" + }, + "auth-error": { + "heading": "", + "heading-with-link": "", + "heading-with-name": "", + "heading-with-name-and-link": "", + "logout": "" + }, + "by": "", + "change-legal-basis-dialog": { + "actions": { + "cancel": "", + "save": "" + }, + "content": { + "comment": "", + "legalBasis": "", + "reason": "", + "reason-placeholder": "" + }, + "header": "" + }, + "comments": { + "hide-comments": "" + }, + "configurations": "", + "confirm-delete-file-attribute": { + "cancel": { + "": "" + }, + "toast-error": "", + "warning": "" + }, + "confirm-delete-users": { + "cancel": { + "": "" + }, + "title": { + "": "" + }, + "toast-error": "", + "warning": "" + }, + "content": "", + "default-colors-screen": { + "table-col-names": { + "color": "", + "key": "" + }, + "table-header": { + "title": "" + }, + "types": { + "": "" + } + }, + "dev-mode": "", + "dictionary-listing": { + "case-sensitive": "", + "stats": { + "charts": { + "entries": "" + } + }, + "table-col-names": { + "hint-redaction": "", + "order-of-importance": "", + "type": "" + }, + "table-header": { + "title": "" + } + }, + "dictionary-overview": { + "compare": { + "compare": "" + }, + "dictionary-details": { + "description": "" + }, + "error": { + "entries-too-short": "", + "generic": "" + }, + "revert-changes": "", + "search": "", + "select-dictionary": "", + "success": { + "generic": "" + } + }, + "digital-signature": "", + "digital-signature-screen": { + "action": { + "certificate-not-valid-error": "", + "delete-error": "", + "delete-success": "", + "reset": "", + "save-error": "", + "save-success": "" + }, + "certificate-name": { + "label": "", + "placeholder": "" + }, + "contact-info": { + "label": "", + "placeholder": "" + }, + "location": { + "label": "", + "placeholder": "" + }, + "password": { + "label": "", + "placeholder": "" + }, + "reason": { + "label": "", + "placeholder": "" + } + }, + "document-info": { + "save": "", + "title": "" + }, + "dossier-attributes-listing": { + "table-col-names": { + "label": "", + "type": "" + }, + "table-header": { + "title": "" + } + }, + "dossier-details": { + "members": "", + "owner": "", + "see-less": "", + "title": "" + }, + "dossier-dictionary-dialog": { + "cancel": "", + "save-changes": "", + "title": "" + }, + "dossier-listing": { + "add-new": "", + "quick-filters": { + "my-dossiers": "", + "other": "", + "to-approve": "", + "to-review": "" + }, + "search": "", + "stats": { + "analyzed-pages": "", + "total-people": "" + }, + "table-col-names": { + "name": "", + "needs-work": "", + "owner": "", + "status": "" + }, + "table-header": { + "title": "" + } + }, + "dossier-overview": { + "dossier-details": { + "attributes": { + "expand": "", + "image-uploaded": "", + "show-less": "" + }, + "description": "", + "dictionary": "", + "stats": { + "analysed-pages": "", + "created-on": "", + "documents": "", + "due-date": "", + "people": "" + } + }, + "file-listing": { + "file-entry": { + "file-error": "", + "file-pending": "", + "file-processing": "" + } + }, + "header-actions": { + "edit": "", + "upload-document": "" + }, + "new-rule": { + "toast": { + "actions": { + "reanalyse-all": "" + } + } + }, + "ocr-performed": "", + "quick-filters": { + "assigned-to-me": "", + "assigned-to-others": "", + "recent": "", + "unassigned": "" + }, + "reanalyse-dossier": { + "error": "", + "success": "" + }, + "search": "", + "table-col-names": { + "added-on": "", + "assigned-to": "", + "name": "", + "needs-work": "", + "pages": "", + "status": "" + }, + "table-header": { + "title": "" + }, + "upload-files": "" + }, + "dossier-templates": "", + "dossier-templates-listing": { + "dictionaries": "", + "table-col-names": { + "created-by": "", + "created-on": "", + "modified-on": "", + "name": "" + }, + "table-header": { + "title": "" + } + }, + "dossiers": { + "delete": { + "delete-failed": "" + } + }, + "download-includes": "", + "download-status": { + "queued": "" + }, + "download-type": { + "label": "" + }, + "downloads-list": { + "table-col-names": { + "date": "", + "name": "", + "size": "", + "status": "" + }, + "table-header": { + "title": "" + } + }, + "edit-color-dialog": { + "error": "", + "form": { + "color": "", + "color-placeholder": "" + }, + "save": "", + "success": "" + }, + "edit-dossier-dialog": { + "actions": { + "revert": "", + "save": "" + }, + "attributes": { + "custom-attributes": "", + "image-attributes": "" + }, + "change-successful": "", + "delete-successful": "", + "dictionary": { + "entries": "" + }, + "general-info": { + "form": { + "description": { + "label": "", + "placeholder": "" + }, + "due-date": "", + "name": { + "label": "", + "placeholder": "" + }, + "template": "", + "watermark": "" + } + }, + "header": "", + "nav-items": { + "": "" + }, + "unsaved-changes": "" + }, + "file-attribute-types": { + "": "" + }, + "file-attributes-csv-import": { + "available": "", + "cancel": "", + "delimiter": "", + "delimiter-placeholder": "", + "encoding": "", + "encoding-placeholder": "", + "file": "", + "key-column": "", + "key-column-placeholder": "", + "no-hovered-column": "", + "no-sample-data-for": "", + "quick-activation": { + "all": "", + "none": "" + }, + "save": { + "error": "", + "label": "", + "success": "" + }, + "selected": "", + "table-col-names": { + "name": "", + "primary": "", + "read-only": "", + "type": "" + }, + "table-header": { + "actions": { + "disable-read-only": "", + "enable-read-only": "" + }, + "title": "" + }, + "title": "", + "total-rows": "" + }, + "file-attributes-listing": { + "read-only": "", + "table-col-names": { + "csv-column": "", + "name": "", + "primary": "", + "read-only": "", + "type": "" + }, + "table-header": { + "title": "" + } + }, + "file-preview": { + "assign-reviewer": "", + "delta": "", + "delta-tooltip": "", + "excluded-from-redaction": "", + "last-reviewer": "", + "quick-nav": { + "jump-first": "", + "jump-last": "" + }, + "redacted": "", + "redacted-tooltip": "", + "standard": "", + "standard-tooltip": "", + "tabs": { + "annotations": { + "label": "", + "page-is": "", + "select": "", + "select-all": "", + "select-none": "" + }, + "document-info": { + "details": { + "created-on": "", + "dossier": "", + "due": "", + "pages": "" + }, + "label": "" + }, + "exclude-pages": { + "error": "", + "label": "", + "no-excluded": "", + "removed-from-redaction": "" + } + } + }, + "filter-menu": { + "filter-options": "", + "filter-types": "", + "label": "" + }, + "filters": { + "assigned-people": "", + "dossier-templates": "", + "filter-by": "", + "needs-work": "", + "people": "", + "status": "" + }, + "hint": "", + "initials-avatar": { + "unassigned": "", + "you": "" + }, + "license-info-screen": { + "analyzed-pages": "", + "backend-version": "", + "chart": { + "cumulative": "", + "legend": "", + "licensed-total": "", + "pages-per-month": "", + "total-pages": "" + }, + "copyright-claim-text": "", + "copyright-claim-title": "", + "current-analyzed": "", + "custom-app-title": "", + "email-report": "", + "email": { + "body": { + "analyzed": "", + "licensed": "" + }, + "title": "" + }, + "end-user-license-text": "", + "end-user-license-title": "", + "frontend-version": "", + "licensed-page-count": "", + "licensed-to": "", + "licensing-details": "", + "licensing-period": "", + "total-analyzed": "", + "unlicensed-analyzed": "", + "usage-details": "" + }, + "license-information": "", + "manual-annotation": { + "dialog": { + "actions": { + "save": "" + }, + "content": { + "comment": "", + "dictionary": "", + "legalBasis": "", + "reason": "", + "reason-placeholder": "", + "rectangle": "", + "text": "" + }, + "header": { + "force": "" + } + } + }, + "notifications": { + "mark-read": "", + "mark-unread": "", + "today": "", + "tomorrow": "", + "yesterday": "" + }, + "overwrite-files-dialog": { + "options": { + "cancel": "", + "overwrite": "", + "remember": "" + }, + "question": "", + "title": "" + }, + "page": "", + "pagination": { + "next": "", + "previous": "" + }, + "pdf-viewer": { + "text-popup": { + "actions": { + "search": "" + } + } + }, + "pending-changes-guard": "", + "readonly": "", + "recategorize-image-dialog": { + "actions": { + "cancel": "", + "save": "" + }, + "content": { + "comment": "", + "type": "", + "type-placeholder": "" + }, + "header": "" + }, + "redaction": "", + "remove-annotations-dialog": { + "confirm": "", + "deny": "", + "dictionary": "", + "image-type": "", + "remove-from-dictionary": { + "question": "", + "title": "" + }, + "remove-only-here": { + "question": "", + "title": "" + }, + "value": "" + }, + "report-type": { + "label": "" + }, + "reports-screen": { + "description": "", + "document-setup-description": "", + "document-setup-heading": "", + "report-documents": "", + "title": "", + "upload-document": "" + }, + "reset-filters": "", + "reset-password-dialog": { + "actions": { + "cancel": "", + "save": "" + }, + "form": { + "password": "" + }, + "header": "" + }, + "roles": { + "NO_ROLE": "" + }, + "rules-screen": { + "error": { + "generic": "" + }, + "revert-changes": "", + "success": { + "generic": "" + } + }, + "smtp-auth-config": { + "actions": { + "cancel": "", + "save": "" + }, + "form": { + "password": "", + "username": "", + "username-placeholder": "" + }, + "title": "" + }, + "smtp-config-screen": { + "actions": { + "save": "" + }, + "form": { + "auth": "", + "change-credentials": "", + "envelope-from": "", + "envelope-from-hint": "", + "envelope-from-placeholder": "", + "from": "", + "from-display-name": "", + "from-display-name-hint": "", + "from-display-name-placeholder": "", + "from-placeholder": "", + "host": "", + "host-placeholder": "", + "port": "", + "reply-to": "", + "reply-to-display-name": "", + "reply-to-display-name-placeholder": "", + "reply-to-placeholder": "", + "ssl": "", + "starttls": "" + }, + "general": { + "form": { + "forgot-password": "" + }, + "subtitle": "", + "title": "" + }, + "subtitle": "", + "test": { + "error": "", + "success": "" + }, + "title": "" + }, + "top-bar": { + "navigation-items": { + "back": "", + "dossiers": "", + "my-account": { + "children": { + "language": { + "label": "" + }, + "logout": "" + } + } + } + }, + "trash": { + "action": { + "delete": "", + "restore": "" + }, + "bulk": { + "delete": "", + "restore": "" + }, + "label": "", + "table-col-names": { + "deleted-on": "", + "name": "", + "owner": "", + "time-to-restore": "" + }, + "table-header": { + "title": "" + } + }, + "upload-status": { + "dialog": { + "title": "" + }, + "error": { + "file-size": "", + "generic": "" + } + }, + "user-listing": { + "table-col-names": { + "active": "", + "email": "", + "name": "", + "roles": "" + }, + "table-header": { + "title": "" + } + }, + "user-management": "", + "user-profile": { + "actions": { + "change-password": "", + "save": "" + }, + "form": { + "email": "", + "first-name": "", + "last-name": "" + }, + "title": "" + }, + "user-stats": { + "title": "" + }, + "watermark-screen": { + "action": { + "change-success": "", + "delete-success": "", + "error": "", + "revert": "" + }, + "form": { + "color": "", + "font-size": "", + "font-type": "", + "opacity": "", + "orientation": "", + "text-placeholder": "" + }, + "title": "" + } +} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/package.json b/package.json index d730af47e..9cd3c3949 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "format:check": "nx format:check", "format:write": "nx format:write", "help": "nx help", + "i18n:extract": "ngx-translate-extract --input ./apps/red-ui/src --output apps/red-ui/src/assets/i18n/te.json --clean --sort --format namespaced-json", "postinstall": "ngcc --properties es2015 browser module main", "lint": "nx workspace-lint && nx lint", "lint-fix": "nx workspace-lint --fix && nx lint --fix", @@ -48,6 +49,7 @@ "@angular/platform-browser-dynamic": "12.0.4", "@angular/router": "12.0.4", "@angular/service-worker": "12.0.4", + "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", "@materia-ui/ngx-monaco-editor": "^5.1.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", @@ -59,9 +61,11 @@ "keycloak-angular": "^8.2.0", "keycloak-js": "13.0.1", "lodash": "^4.17.21", + "messageformat": "^2.3.0", "moment": "^2.29.1", "ngx-color-picker": "^11.0.0", "ngx-toastr": "^14.0.0", + "ngx-translate-messageformat-compiler": "^4.10.0", "papaparse": "^5.3.1", "rxjs": "~6.6.7", "sass": "^1.35.1", @@ -78,6 +82,7 @@ "@angular/cli": "12.0.4", "@angular/compiler-cli": "12.0.4", "@angular/language-service": "12.0.4", + "@biesbjerg/ngx-translate-extract": "^7.0.4", "@nrwl/cli": "12.3.6", "@nrwl/cypress": "12.3.6", "@nrwl/eslint-plugin-nx": "12.3.6", diff --git a/yarn.lock b/yarn.lock index 75e959ec1..e71c35272 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2352,6 +2352,29 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biesbjerg/ngx-translate-extract-marker@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@biesbjerg/ngx-translate-extract-marker/-/ngx-translate-extract-marker-1.0.0.tgz#3c50b5305fb2ffe4826c1473e25e6f746bb31916" + integrity sha512-GlCBQKmFE+b+qfIO0aGvuRc4LJVSfK27K2QQFXZLP55/w28iiq/q2CnBS8ya+4l+hapm7U3QPtFoZu9lmbUuew== + dependencies: + tslib "^1.9.0" + +"@biesbjerg/ngx-translate-extract@^7.0.4": + version "7.0.4" + resolved "https://registry.yarnpkg.com/@biesbjerg/ngx-translate-extract/-/ngx-translate-extract-7.0.4.tgz#98190aa798dfe78a9f33904256891e76634fd52c" + integrity sha512-33hR94Fu26LK7Z+ImW2IdZiHfOcAzyIs1CdkUXg/536z2MqxBYqPoI9Ghsk6RTEfnsGa65wMgOcDXn7Ilhp8ew== + dependencies: + "@phenomnomnominal/tsquery" "^4.1.1" + boxen "^5.0.1" + colorette "^1.2.2" + flat "^5.0.2" + gettext-parser "^4.0.4" + glob "^7.1.6" + mkdirp "^1.0.4" + path "^0.12.7" + terminal-link "^2.1.1" + yargs "^16.2.0" + "@csstools/convert-colors@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" @@ -2878,6 +2901,13 @@ resolved "https://registry.yarnpkg.com/@pdftron/webviewer/-/webviewer-7.3.3.tgz#e5ada58c4c4a4101a095507673ba2278042942ef" integrity sha512-cTJf9pXlN9tilliO8NgKw6vn1PPXSHKLOrUS7j4f+0sz2BJDVwO2rlI4BJBQ5BT2qIru1dg2GxYUyeXOqNyi9Q== +"@phenomnomnominal/tsquery@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz#42971b83590e9d853d024ddb04a18085a36518df" + integrity sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ== + dependencies: + esquery "^1.0.1" + "@rollup/plugin-commonjs@^19.0.0": version "19.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.0.tgz#8c3e71f9a66908e60d70cc1be205834ef3e45f71" @@ -3836,6 +3866,13 @@ alphanum-sort@^1.0.2: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= +ansi-align@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + dependencies: + string-width "^3.0.0" + ansi-colors@4.1.1, ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -4413,6 +4450,20 @@ boolbase@^1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +boxen@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.0.1.tgz#657528bdd3f59a772b8279b831f27ec2c744664b" + integrity sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.0" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -4923,6 +4974,11 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -5205,7 +5261,7 @@ content-disposition@0.5.3: dependencies: safe-buffer "5.1.2" -content-type@~1.0.4: +content-type@^1.0.4, content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== @@ -6285,7 +6341,7 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -encoding@^0.1.12: +encoding@^0.1.12, encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -6652,7 +6708,7 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: +esquery@^1.0.1, esquery@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== @@ -7409,6 +7465,16 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +gettext-parser@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/gettext-parser/-/gettext-parser-4.0.4.tgz#bd5eb4af282336c8bf83f607d35f0839853b9670" + integrity sha512-VDZEeOIYd0veZXt5iAn0SS3I0Fz14fJw+59avRNa7VIslEDriRLxcfrBd/xeQyOcm6nyS4uuufxm2iw88qirAg== + dependencies: + content-type "^1.0.4" + encoding "^0.1.13" + readable-stream "^3.6.0" + safe-buffer "^5.2.1" + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -9589,6 +9655,13 @@ make-fetch-happen@^8.0.9: socks-proxy-agent "^5.0.0" ssri "^8.0.0" +make-plural@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/make-plural/-/make-plural-4.3.0.tgz#f23de08efdb0cac2e0c9ba9f315b0dff6b4c2735" + integrity sha512-xTYd4JVHpSCW+aqDof6w/MebaMVNTVYBZhbB/vi513xXdiPT92JMVCo0Jq8W2UZnzYRFeVbQiQ+I25l13JuKvA== + optionalDependencies: + minimist "^1.2.0" + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -9692,6 +9765,25 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +messageformat-formatters@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/messageformat-formatters/-/messageformat-formatters-2.0.1.tgz#0492c1402a48775f751c9b17c0354e92be012b08" + integrity sha512-E/lQRXhtHwGuiQjI7qxkLp8AHbMD5r2217XNe/SREbBlSawe0lOqsFb7rflZJmlQFSULNLIqlcjjsCPlB3m3Mg== + +messageformat-parser@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/messageformat-parser/-/messageformat-parser-4.1.3.tgz#b824787f57fcda7d50769f5b63e8d4fda68f5b9e" + integrity sha512-2fU3XDCanRqeOCkn7R5zW5VQHWf+T3hH65SzuqRvjatBK7r4uyFa5mEX+k6F9Bd04LVM5G4/BHBTUJsOdW7uyg== + +messageformat@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/messageformat/-/messageformat-2.3.0.tgz#de263c49029d5eae65d7ee25e0754f57f425ad91" + integrity sha512-uTzvsv0lTeQxYI2y1NPa1lItL5VRI8Gb93Y2K2ue5gBPyrbJxfDi/EYWxh2PKv5yO42AJeeqblS9MJSh/IEk4w== + dependencies: + make-plural "^4.3.0" + messageformat-formatters "^2.0.1" + messageformat-parser "^4.1.2" + methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -10101,6 +10193,13 @@ ngx-toastr@^14.0.0: dependencies: tslib "^2.1.0" +ngx-translate-messageformat-compiler@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/ngx-translate-messageformat-compiler/-/ngx-translate-messageformat-compiler-4.10.0.tgz#f670252a9bbcbc24664765fb7584424d55d319b2" + integrity sha512-SA7H4eZ2BE5HUqgRiyNMHNnRUAINCD3bgLMrBm12ktbjppK74DMFiWq7bsRen/X569vqGEr16uQ/RkTHHLeqKg== + dependencies: + tslib "^1.10.0" + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -10863,6 +10962,14 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +path@^0.12.7: + version "0.12.7" + resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f" + integrity sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8= + dependencies: + process "^0.11.1" + util "^0.10.3" + pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -11674,7 +11781,7 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.11.10: +process@^0.11.1, process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= @@ -12300,7 +12407,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -12951,6 +13058,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.0.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -13243,7 +13359,7 @@ tar@^6.1.0: mkdirp "^1.0.3" yallist "^4.0.0" -terminal-link@^2.0.0: +terminal-link@^2.0.0, terminal-link@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" integrity sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ== @@ -13768,6 +13884,13 @@ util@0.10.3: dependencies: inherits "2.0.1" +util@^0.10.3: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + util@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" @@ -14198,6 +14321,13 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + wildcard@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" From 1f50eafee28bf2cbc9c5d2eed529505c51783c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Sat, 17 Jul 2021 00:53:54 +0300 Subject: [PATCH 02/25] Prepare for pluralization --- apps/red-ui/src/app/app.module.ts | 22 ++-- apps/red-ui/src/assets/i18n/en.json | 160 ++++++++++++++-------------- apps/red-ui/src/assets/i18n/te.json | 2 + 3 files changed, 90 insertions(+), 94 deletions(-) diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 987f7f9d1..3fa8395fb 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -7,7 +7,7 @@ import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common import { BaseScreenComponent } from '@components/base-screen/base-screen.component'; import { ApiModule } from '@redaction/red-ui-http'; import { ApiPathInterceptor } from '@utils/api-path-interceptor'; -import { MissingTranslationHandler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; +import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { languageInitializer } from '@i18n/language.initializer'; import { LanguageService } from '@i18n/language.service'; @@ -30,6 +30,7 @@ import { BASE_HREF } from './tokens'; import { MONACO_PATH, MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'; import { GlobalErrorHandler } from '@utils/global-error-handler.service'; import { REDMissingTranslationHandler } from '@utils/missing-translations-handler'; +import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; export function httpLoaderFactory(httpClient: HttpClient) { return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json'); @@ -47,14 +48,7 @@ function cleanupBaseUrl(baseUrl: string) { const screens = [BaseScreenComponent, DownloadsListScreenComponent, UserProfileScreenComponent]; -const components = [ - AppComponent, - LogoComponent, - AuthErrorComponent, - ToastComponent, - NotificationsComponent, - ...screens -]; +const components = [AppComponent, LogoComponent, AuthErrorComponent, ToastComponent, NotificationsComponent, ...screens]; @NgModule({ declarations: [...components], @@ -78,6 +72,10 @@ const components = [ provide: TranslateLoader, useFactory: httpLoaderFactory, deps: [HttpClient] + }, + compiler: { + provide: TranslateCompiler, + useClass: TranslateMessageFormatCompiler } }), ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }) @@ -126,11 +124,7 @@ export class AppModule { private _configureKeyCloakRouteHandling() { this._route.queryParamMap.subscribe(queryParams => { - if ( - queryParams.has('code') || - queryParams.has('state') || - queryParams.has('session_state') - ) { + if (queryParams.has('code') || queryParams.has('state') || queryParams.has('session_state')) { this._router.navigate([], { queryParams: { state: null, diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index cb33e9c3d..2f6041703 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -51,7 +51,7 @@ }, "save": "Save Dictionary", "title": { - "edit": "Edit {{name}} Dictionary", + "edit": "Edit {name} Dictionary", "new": "Create Dictionary" } }, @@ -66,7 +66,7 @@ }, "save": "Save Dossier Template", "title": { - "edit": "Edit {{name}} Dossier Template", + "edit": "Edit {name} Dossier Template", "new": "Create Dossier Template" } }, @@ -82,7 +82,7 @@ }, "save": "Save Attribute", "title": { - "edit": "Edit {{name}} File Attribute", + "edit": "Edit {name} File Attribute", "new": "Add New File Attribute" } }, @@ -95,7 +95,7 @@ }, "save": "Save Attribute", "title": { - "edit": "Edit {{name}} Dossier Attribute", + "edit": "Edit {name} Dossier Attribute", "new": "Add New Dossier Attribute" }, "error": { @@ -139,78 +139,78 @@ "message": { "dictionary": { "add": { - "error": "Failed to add entry to dictionary: {{error}}", + "error": "Failed to add entry to dictionary: {error}", "success": "Entry added to dictionary. Changes will be visible after reanalysis." }, "approve": { - "error": "Failed to approve dictionary entry: {{error}}", + "error": "Failed to approve dictionary entry: {error}", "success": "Dictionary entry approved. Changes will be visible after reanalysis." }, "decline": { - "error": "Failed to decline dictionary suggestion: {{error}}", + "error": "Failed to decline dictionary suggestion: {error}", "success": "Dictionary suggestion declined." }, "remove": { - "error": "Failed to remove dictionary entry: {{error}}", + "error": "Failed to remove dictionary entry: {error}", "success": "Dictionary entry removed!" }, "request-remove": { - "error": "Failed to request removal of dictionary entry: {{error}}", + "error": "Failed to request removal of dictionary entry: {error}", "success": "Requested to remove dictionary entry!" }, "suggest": { - "error": "Failed to save suggestion for dictionary modification: {{error}}", + "error": "Failed to save suggestion for dictionary modification: {error}", "success": "Suggestion for dictionary modification saved!" }, "undo": { - "error": "Failed to undo: {{error}}", + "error": "Failed to undo: {error}", "success": "Undo successful" } }, "manual-redaction": { "add": { - "error": "Failed to save redaction: {{error}}", + "error": "Failed to save redaction: {error}", "success": "Redaction added!" }, "force-redaction": { - "error": "Failed to save redaction: {{error}}", + "error": "Failed to save redaction: {error}", "success": "Redaction added!" }, "approve": { - "error": "Failed to approve suggestion: {{error}}", + "error": "Failed to approve suggestion: {error}", "success": "Suggestion approved." }, "change-legal-basis": { - "error": "Failed to edit annotation reason: {{error}}", + "error": "Failed to edit annotation reason: {error}", "success": "Annotation reason was edited." }, "decline": { - "error": "Failed to decline suggestion: {{error}}", + "error": "Failed to decline suggestion: {error}", "success": "Suggestion declined." }, "request-change-legal-basis": { - "error": "Failed to request annotation reason change: {{error}}", + "error": "Failed to request annotation reason change: {error}", "success": "Annotation reason change requested." }, "recategorize-image": { - "error": "Failed to recategorize image: {{error}}", + "error": "Failed to recategorize image: {error}", "success": "Image recategorized." }, "request-image-recategorization": { - "error": "Failed to request image recategorization: {{error}}", + "error": "Failed to request image recategorization: {error}", "success": "Image recategorization requested." }, "search": "Document name...", "suggest": { - "error": "Failed to save redaction suggestion: {{error}}", + "error": "Failed to save redaction suggestion: {error}", "success": "Redaction suggestion saved" }, "request-force-redaction": { - "error": "Failed to save redaction suggestion: {{error}}", + "error": "Failed to save redaction suggestion: {error}", "success": "Redaction suggestion saved" }, "undo": { - "error": "Failed to undo: {{error}}", + "error": "Failed to undo: {error}", "success": "Undo successful" } } @@ -311,15 +311,15 @@ "user": "User" }, "table-header": { - "title": "{{length}} Logs" + "title": "{length} Logs" }, "to": "to" }, "auth-error": { "heading": "Your user doesn't have the required RED-* roles to access this application. Please contact your admin for access!", - "heading-with-link": "Your user doesn't have the required RED-* roles to access this application. Please contact your admin for access!", - "heading-with-name": "Your user doesn't have the required RED-* roles to access this application. Please contact {{adminName}} for access!", - "heading-with-name-and-link": "Your user doesn't have the required RED-* roles to access this application. Please contact {{adminName}} for access!", + "heading-with-link": "Your user doesn't have the required RED-* roles to access this application. Please contact your admin for access!", + "heading-with-name": "Your user doesn't have the required RED-* roles to access this application. Please contact {adminName} for access!", + "heading-with-name-and-link": "Your user doesn't have the required RED-* roles to access this application. Please contact {adminName} for access!", "logout": "Logout" }, "by": "by", @@ -356,7 +356,7 @@ } }, "reset-password-dialog": { - "header": "Set Temporary Password for {{userName}}", + "header": "Set Temporary Password for {userName}", "form": { "password": "Temporary password" }, @@ -369,8 +369,8 @@ "comments": { "add-comment": "Enter comment", "cancel": "Cancel", - "comment": "{{count}} comment", - "comments": "{{count}} comments", + "comment": "{count} comment", + "comments": "{count} comments", "hide-comments": "Hide comments" }, "common": { @@ -399,7 +399,7 @@ "lost-details": "All inputted details on the documents will be lost", "title": { "bulk": "Delete File Attributes", - "single": "Delete {{name}}" + "single": "Delete {name}" }, "toast-error": "Please confirm that you understand the ramifications of your action!", "warning": "Warning: this cannot be undone!" @@ -417,7 +417,7 @@ "bulk": "All documents pending review from the users will be impacted", "single": "All documents pending review from the user will be impacted" }, - "impacted-dossiers": "{{dossiersCount}} dossiers will be impacted", + "impacted-dossiers": "{dossiersCount} dossiers will be impacted", "title": { "bulk": "Delete Users from Workspace", "single": "Delete User from Workspace" @@ -431,16 +431,16 @@ "title": "Re-assign reviewer" }, "compare-file": { - "question": "Warning!

Number of pages does not match, current document has {{currentDocumentPageCount}} page(s). Uploaded document has {{compareDocumentPageCount}} page(s).

Do you wish to proceed?", - "title": "Compare with file: {{fileName}}" + "question": "Warning!

Number of pages does not match, current document has {currentDocumentPageCount} page(s). Uploaded document has {compareDocumentPageCount} page(s).

Do you wish to proceed?", + "title": "Compare with file: {fileName}" }, "delete-dossier": { "confirmation-text": "Delete Dossier", "deny-text": "Keep Dossier", - "details": "Deleted dossiers are sent to trash. They can be restored up to {{period}} days from their deletion.", + "details": "Deleted dossiers are sent to trash. They can be restored up to {period} days from their deletion.", "input-label": "To proceed please type below", "question": "Are you sure you want to delete this dossier?", - "title": "Delete {{dossierName}}" + "title": "Delete {dossierName}" }, "delete-file": { "question": "Do you wish to proceed?", @@ -458,7 +458,7 @@ "key": "Type" }, "table-header": { - "title": "{{length}} Default Colors" + "title": "{length} Default Colors" }, "types": { "analysisColor": "Analysis", @@ -506,7 +506,7 @@ "type": "Type" }, "table-header": { - "title": "{{length}} dictionaries" + "title": "{length} dictionaries" } }, "dictionary-overview": { @@ -595,7 +595,7 @@ "add-new": "New Dossier", "delete": { "action": "Delete Dossier", - "delete-failed": "Failed to delete dossier: {{dossierName}}" + "delete-failed": "Failed to delete dossier: {dossierName}" }, "download-files": { "action": "Download Redacted Files" @@ -637,7 +637,7 @@ }, "table-header": { "recent": "Recent", - "title": "{{length}} active dossiers" + "title": "{length} active dossiers" } }, "dossier-member-guard": { @@ -659,7 +659,7 @@ "dossier-details": { "attributes": { "image-uploaded": "Image uploaded", - "expand": "{{count}} custom attributes", + "expand": "{count} custom attributes", "show-less": "show less" }, "charts": { @@ -668,11 +668,11 @@ "description": "Description", "dictionary": "Dossier Dictionary", "stats": { - "analysed-pages": "{{count}} pages", - "created-on": "Created on {{date}}", - "documents": "{{count}} documents", - "due-date": "Due {{date}}", - "people": "{{count}} user(s)" + "analysed-pages": "{count} pages", + "created-on": "Created on {date}", + "documents": "{count} documents", + "due-date": "Due {date}", + "people": "{count} user(s)" } }, "download-file": "Download", @@ -708,7 +708,7 @@ "quick-filters": { "assigned-to-me": "Assigned to me", "assigned-to-others": "Assigned to others", - "recent": "Recent ({{hours}} h)", + "recent": "Recent ({hours} h)", "unassigned": "Unassigned" }, "reanalyse": { @@ -728,7 +728,7 @@ "status": "Status" }, "table-header": { - "title": "{{length}} documents" + "title": "{length} documents" }, "under-approval": "For Approval", "under-review": "Under Review", @@ -744,7 +744,7 @@ "bulk": { "delete": "Delete Selected Dossier Templates" }, - "dictionaries": "{{length}} dictionaries", + "dictionaries": "{length} dictionaries", "no-data": { "title": "There are no dossier templates yet." }, @@ -759,15 +759,15 @@ "name": "Name" }, "table-header": { - "title": "{{length}} dossier templates" + "title": "{length} dossier templates" } }, "download-includes": "Choose what is included at download:", "download-status": { - "queued": "Your download has been queued, you can see all your requested downloads here: My Downloads ." + "queued": "Your download has been queued, you can see all your requested downloads here: My Downloads ." }, "download-type": { - "label": "{{length}} document versions", + "label": "{length} document versions", "ORIGINAL": "Optimized PDF", "PREVIEW": "Preview PDF", "REDACTED": "Redacted PDF" @@ -788,7 +788,7 @@ "type": "Type" }, "table-header": { - "title": "{{length}} downloads" + "title": "{length} downloads" } }, "edit-color-dialog": { @@ -798,7 +798,7 @@ "color-placeholder": "Color" }, "save": "Save", - "success": "Successfully updated color for {{color}}." + "success": "Successfully updated color for {color}." }, "edit-dossier-dialog": { "actions": { @@ -808,7 +808,7 @@ "change-successful": "Dossier was updated.", "delete-successful": "Dossier was deleted.", "dictionary": { - "entries": "{{length}} entries" + "entries": "{length} entries" }, "general-info": { "form": { @@ -825,7 +825,7 @@ "watermark": "Watermark application on redacted documents" } }, - "header": "Edit {{dossierName}}", + "header": "Edit {dossierName}", "nav-items": { "choose-download": "Choose what is included at download:", "dictionary": "Dictionary", @@ -870,7 +870,7 @@ "remove": "Remove", "save-name": "Save" }, - "available": "{{value}} available", + "available": "{value} available", "cancel": "Cancel", "csv-column": "CSV Column", "delimiter": "Delimiter", @@ -884,7 +884,7 @@ "title": "No file attributes defined. Select a column from the left panel to start defining file attributes." }, "no-hovered-column": "Preview CSV column by hovering the entry.", - "no-sample-data-for": "No sample data for {{column}}.", + "no-sample-data-for": "No sample data for {column}.", "parse-csv": "Parse CSV with new options", "quick-activation": { "all": "All", @@ -893,12 +893,12 @@ "save": { "error": "Failed to create File Attributes!", "label": "Save Attributes", - "success": "{{count}} File Attributes created successfully!" + "success": "{count} File Attributes created successfully!" }, "search": { "placeholder": "Search by column name..." }, - "selected": "{{value}} selected", + "selected": "{value} selected", "table-col-names": { "name": "Name", "primary": "primary", @@ -914,10 +914,10 @@ "remove-selected": "Remove Selected", "type": "Type" }, - "title": "{{length}} file attributes" + "title": "{length} file attributes" }, "title": "Select CSV columns to use as File Attributes", - "total-rows": "{{rows}} rows in total" + "total-rows": "{rows} rows in total" }, "file-attributes-listing": { "action": { @@ -945,7 +945,7 @@ "type": "Input Type" }, "table-header": { - "title": "{{length}} file attributes" + "title": "{length} file attributes" }, "upload-csv": "Upload File Attributes Configuration" }, @@ -973,7 +973,7 @@ "type": "Type" }, "table-header": { - "title": "{{length}} dossier attributes" + "title": "{length} dossier attributes" } }, "file-preview": { @@ -1017,10 +1017,10 @@ "document-info": { "close": "Close Document Info", "details": { - "created-on": "Created on: {{date}}", - "dossier": "in {{dossierName}}", - "due": "Due: {{date}}", - "pages": "{{pages}} pages" + "created-on": "Created on: {date}", + "dossier": "in {dossierName}", + "due": "Due: {date}", + "pages": "{pages} pages" }, "edit": "Edit Document Info", "label": "Document Info" @@ -1087,16 +1087,16 @@ "pages-per-month": "Pages per Month", "total-pages": "Total Pages" }, - "copyright-claim-text": "Copyright ยฉ 2020 - {{currentYear}} knecon AG (powered by IQSER)", + "copyright-claim-text": "Copyright ยฉ 2020 - {currentYear} knecon AG (powered by IQSER)", "copyright-claim-title": "Copyright Claim", "current-analyzed": "Analyzed Pages in Current Licensing Period", "custom-app-title": "Custom Application Title", "email": { "body": { - "analyzed": "Total Analyzed Pages in current license period: {{pages}}.", - "licensed": "Licensed Pages: {{pages}}." + "analyzed": "Total Analyzed Pages in current license period: {pages}.", + "licensed": "Licensed Pages: {pages}." }, - "title": "License Report {{licenseCustomer}}" + "title": "License Report {licenseCustomer}" }, "email-report": "Email Report", "end-user-license-text": "The use of this product is subject to the terms of the Redaction End User Agreement, unless other specified therein.", @@ -1106,7 +1106,7 @@ "licensed-to": "Licensed to", "licensing-details": "Licensing Details", "licensing-period": "Licensing Period", - "total-analyzed": "Total Analyzed Pages Since {{date}}", + "total-analyzed": "Total Analyzed Pages Since {date}", "unlicensed-analyzed": "Unlicensed Analyzed Pages", "usage-details": "Usage Details" }, @@ -1155,7 +1155,7 @@ "remember": "Remember choice and don't ask me again", "skip": "Keep existing document" }, - "question": "{{filename}} already exists. Choose how to proceed:", + "question": "{filename} already exists. Choose how to proceed:", "title": "Document already exists!" }, "page": "Page", @@ -1179,7 +1179,7 @@ "confirm": "Yes, proceed and remove!", "deny": "Cancel", "dictionary": "Dictionary", - "image-type": "Image: {{typeLabel}}", + "image-type": "Image: {typeLabel}", "remove-from-dictionary": { "question": "Following entries will be removed from their respective dictionaries:", "title": "Remove From Dictionary" @@ -1193,7 +1193,7 @@ "report-type": { "EXCEL_MULTI_FILE": "Excel (for all)", "EXCEL_SINGLE_FILE": "Excel (per file)", - "label": "{{length}} report types", + "label": "{length} report types", "WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE": "Justification Appendix A1", "WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE": "Justification Appendix A2" }, @@ -1286,8 +1286,8 @@ "trash": { "label": "Trash", "table-header": { - "title": "{{length}} deleted dossiers", - "info": "Deleted items can be restored up to {{hours}} hours from their deletions" + "title": "{length} deleted dossiers", + "info": "Deleted items can be restored up to {hours} hours from their deletions" }, "bulk": { "delete": "Forever Delete Selected Dossiers", @@ -1347,10 +1347,10 @@ "cancel": "Cancel Upload", "re-upload": "Retry Upload" }, - "title": "File Uploads ({{len}})" + "title": "File Uploads ({len})" }, "error": { - "file-size": "File too large. Limit is {{size}}MB.", + "file-size": "File too large. Limit is {size}MB.", "generic": "Failed to upload file. " } }, @@ -1375,7 +1375,7 @@ "roles": "Roles" }, "table-header": { - "title": "{{length}} users" + "title": "{length} users" } }, "user-management": "User Management", diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 83f2574bf..706acba0d 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -503,6 +503,7 @@ "table-col-names": { "name": "", "primary": "", + "primary-info-tooltip": "", "read-only": "", "type": "" }, @@ -522,6 +523,7 @@ "csv-column": "", "name": "", "primary": "", + "primary-info-tooltip": "", "read-only": "", "type": "" }, From 3d9eebb604d4502d9badcf617d6c5be8adf4f77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 19 Jul 2021 16:23:41 +0300 Subject: [PATCH 03/25] Translation rework: Empty state, icon button --- .../downloads-list-screen.component.html | 6 +- .../user-details/user-details.component.html | 20 +---- .../active-fields-listing.component.html | 6 +- .../screens/audit/audit-screen.component.html | 6 +- .../dictionary-listing-screen.component.html | 8 +- .../digital-signature-screen.component.html | 56 ++++--------- ...r-attributes-listing-screen.component.html | 7 +- ...er-templates-listing-screen.component.html | 13 ++- ...e-attributes-listing-screen.component.html | 10 ++- .../screens/rules/rules-screen.component.html | 18 +--- .../smtp-config-screen.component.html | 83 ++++--------------- .../screens/trash/trash-screen.component.html | 4 +- .../user-listing-screen.component.html | 5 +- .../watermark/watermark-screen.component.html | 2 +- .../file-workload.component.html | 19 +++-- .../add-dossier-dialog.component.html | 33 ++------ .../edit-dossier-attributes.component.html | 2 +- .../edit-dossier-general-info.component.html | 23 ++--- .../dossier-listing-screen.component.html | 5 +- .../dossier-overview-screen.component.html | 5 +- .../icon-button/icon-button.component.html | 2 +- .../icon-button/icon-button.component.ts | 3 +- .../dictionary-manager.component.html | 36 ++------ .../empty-state/empty-state.component.html | 10 +-- .../empty-state/empty-state.component.ts | 3 +- .../popup-filter/popup-filter.component.html | 54 +++--------- .../page-header/page-header.component.html | 12 +-- .../overwrite-files-dialog.component.html | 15 +--- 28 files changed, 150 insertions(+), 316 deletions(-) diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index 604d6cc14..27d023fa7 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -27,7 +27,11 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html index 3e8f0a829..cdae4789e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html @@ -37,30 +37,18 @@
- -
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index 507db984c..5d9fd6c4e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -80,7 +80,11 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 677820c46..14cade35c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -107,7 +107,11 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index 9d675e87c..c2a178587 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -51,8 +51,8 @@
@@ -90,15 +90,15 @@ diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html index 18b923648..1667b8727 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html @@ -22,39 +22,21 @@
-
- + + -
- +
+ @@ -67,9 +49,7 @@ > @@ -78,9 +58,7 @@
@@ -89,9 +67,7 @@
@@ -100,9 +76,7 @@
@@ -112,16 +86,16 @@ @@ -139,6 +113,4 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index ce510f9fe..38125a050 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -51,8 +51,8 @@
@@ -83,12 +83,13 @@ - +
@@ -89,9 +89,16 @@
- + - +
@@ -113,9 +113,13 @@
- + - + 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 cef6a100c..dc97529c9 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 @@ -20,28 +20,18 @@
- +
-
+
- + diff --git a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html index 7bb320818..a7a43ce4f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html @@ -32,10 +32,7 @@ [(ngModel)]="generalSettings.forgotPasswordFunctionEnabled" color="primary" > - +
@@ -64,9 +61,7 @@
@@ -81,30 +76,20 @@
- + - +
@@ -112,69 +97,44 @@
- +
- + - +
- +
- +
- +
-
@@ -208,6 +163,4 @@
- + diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html index 5c84eaab6..61385b36b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.html @@ -66,9 +66,9 @@
- + - +
diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html index d87d01af3..3450226a8 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html @@ -25,8 +25,8 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html index 29cd7505d..396cd8b6d 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html @@ -46,12 +46,12 @@ > {{ selectedAnnotations?.length || 0 }} selected @@ -130,7 +130,12 @@ tabindex="1" > - + {{ 'file-preview.tabs.annotations.page-is' | translate }}
@@ -142,16 +147,16 @@
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html index 3584648d4..405737a9a 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html @@ -16,18 +16,10 @@
{{ 'add-dossier-dialog.form.template' | translate }} - + @@ -54,21 +46,12 @@
- + {{ 'add-dossier-dialog.form.due-date' | translate }}
- + @@ -102,16 +85,12 @@
- + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html index f641b9463..4ae754bea 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html @@ -54,9 +54,9 @@ (action)="fileInputClick(attr)" *ngIf="!currentAttrValue(attr)" [disabled]="!canEdit" + [label]="'edit-dossier-dialog.attributes.upload-image' | translate" class="upload-button" icon="red:upload" - text="edit-dossier-dialog.attributes.upload-image" type="show-bg" > diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html index 0fe55be18..b18f3ed26 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/general-info/edit-dossier-general-info.component.html @@ -11,17 +11,11 @@
- {{ - 'edit-dossier-dialog.general-info.form.template' | translate - }} + {{ 'edit-dossier-dialog.general-info.form.template' | translate }} @@ -34,9 +28,7 @@
@@ -46,12 +40,7 @@ {{ 'add-edit-dossier-template.form.valid-from' | translate }} - + {{ 'add-edit-dossier-template.form.valid-to' | translate }}
@@ -59,11 +48,7 @@
- + @@ -73,11 +58,7 @@
- + @@ -94,8 +75,7 @@ 'report-type.label' | translate : { - length: this.dossierTemplateForm.controls['reportTypes'].value - .length + length: this.dossierTemplateForm.controls['reportTypes'].value.length } " [options]="reportTypesEnum" @@ -108,8 +88,7 @@ 'download-type.label' | translate : { - length: this.dossierTemplateForm.controls['downloadFileTypes'] - .value.length + length: this.dossierTemplateForm.controls['downloadFileTypes'].value.length } " [options]="downloadTypesEnum" @@ -120,20 +99,11 @@
-
- + 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 712d9405f..a0da03587 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 @@ -40,19 +40,11 @@ export class AddEditDossierTemplateDialogComponent { this.dossierTemplate?.validTo ? moment(this.dossierTemplate?.validTo) : null, this._requiredIfValidator(() => this.hasValidTo) ], - downloadFileTypes: [ - this.dossierTemplate - ? this.dossierTemplate.downloadFileTypes - : ['PREVIEW', 'REDACTED'] - ], + downloadFileTypes: [this.dossierTemplate ? this.dossierTemplate.downloadFileTypes : ['PREVIEW', 'REDACTED']], reportTypes: [ this.dossierTemplate ? this.dossierTemplate.reportTypes - : [ - 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE', - 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE', - 'EXCEL_MULTI_FILE' - ], + : ['WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE', 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE', 'EXCEL_MULTI_FILE'], Validators.required ] }); @@ -77,9 +69,7 @@ export class AddEditDossierTemplateDialogComponent { } if ( this.hasValidFrom && - !moment(this.dossierTemplate.validFrom).isSame( - moment(this.dossierTemplateForm.get('validFrom').value) - ) + !moment(this.dossierTemplate.validFrom).isSame(moment(this.dossierTemplateForm.get('validFrom').value)) ) { return true; } @@ -89,9 +79,7 @@ export class AddEditDossierTemplateDialogComponent { } if ( this.hasValidTo && - !moment(this.dossierTemplate.validTo).isSame( - moment(this.dossierTemplateForm.get('validTo').value) - ) + !moment(this.dossierTemplate.validTo).isSame(moment(this.dossierTemplateForm.get('validTo').value)) ) { return true; } @@ -110,9 +98,7 @@ export class AddEditDossierTemplateDialogComponent { validFrom: this.hasValidFrom ? this.dossierTemplateForm.get('validFrom').value : null, validTo: this.hasValidTo ? this.dossierTemplateForm.get('validTo').value : null }; - await this._dossierTemplateController - .createOrUpdateDossierTemplate(dossierTemplate) - .toPromise(); + await this._dossierTemplateController.createOrUpdateDossierTemplate(dossierTemplate).toPromise(); await this._appStateService.loadAllDossierTemplates(); await this._appStateService.loadDictionaryData(); this.dialogRef.close(dossierTemplate); diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html index a5fe99f58..3062a8234 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html @@ -1,10 +1,8 @@
{{ - (fileAttribute - ? 'add-edit-file-attribute.title.edit' - : 'add-edit-file-attribute.title.new' - ) | translate: { name: fileAttribute?.label } + (fileAttribute ? 'add-edit-file-attribute.title.edit' : 'add-edit-file-attribute.title.new') + | translate: { name: fileAttribute?.label } }}
@@ -25,9 +23,7 @@
@@ -49,31 +45,18 @@
- + {{ 'add-edit-file-attribute.form.primary' | translate }}
-
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts index f707f6332..c24f4576f 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts @@ -13,11 +13,7 @@ export class AddEditFileAttributeDialogComponent { fileAttributeForm: FormGroup; fileAttribute: FileAttributeConfig; dossierTemplateId: string; - readonly typeOptions = [ - FileAttributeConfig.TypeEnum.TEXT, - FileAttributeConfig.TypeEnum.NUMBER, - FileAttributeConfig.TypeEnum.DATE - ]; + readonly typeOptions = [FileAttributeConfig.TypeEnum.TEXT, FileAttributeConfig.TypeEnum.NUMBER, FileAttributeConfig.TypeEnum.DATE]; constructor( private readonly _appStateService: AppStateService, @@ -32,10 +28,7 @@ export class AddEditFileAttributeDialogComponent { this.fileAttributeForm = this._formBuilder.group({ label: [this.fileAttribute?.label, Validators.required], csvColumnHeader: [this.fileAttribute?.csvColumnHeader, Validators.required], - type: [ - this.fileAttribute?.type || FileAttributeConfig.TypeEnum.TEXT, - Validators.required - ], + type: [this.fileAttribute?.type || FileAttributeConfig.TypeEnum.TEXT, Validators.required], readonly: [this.fileAttribute ? !this.fileAttribute.editable : false], primaryAttribute: [this.fileAttribute?.primaryAttribute] }); diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.html index 17b725f7a..6cf1ed70c 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/add-edit-user-dialog.component.html @@ -13,9 +13,5 @@ [user]="user" > - + 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 6d91c4d8f..e79719568 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 @@ -10,10 +10,7 @@ import { User } from '@redaction/red-ui-http'; export class AddEditUserDialogComponent { resettingPassword = false; - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public user: User - ) {} + constructor(public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public user: User) {} toggleResetPassword() { this.resettingPassword = !this.resettingPassword; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/reset-password/reset-password.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/reset-password/reset-password.component.html index fee0ff69f..18392a3fd 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/reset-password/reset-password.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/reset-password/reset-password.component.html @@ -1,8 +1,4 @@ -
+
@@ -17,10 +13,6 @@ {{ 'reset-password-dialog.actions.save' | translate }} -
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html index 49371a4c8..4ace83050 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html @@ -1,9 +1,6 @@
- {{ - 'confirm-delete-file-attribute.title.' + type - | translate: { name: fileAttribute?.label } - }} + {{ 'confirm-delete-file-attribute.title.' + type | translate: { name: fileAttribute?.label } }}
@@ -30,15 +27,7 @@ -
+
- +
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html index c2e0d3bd0..108baa141 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html @@ -17,10 +17,7 @@ [class.error]="!checkbox.value && showToast" color="primary" > - {{ - 'confirm-delete-users.' + checkbox.label - | translate: { dossiersCount: dossiersCount } - }} + {{ 'confirm-delete-users.' + checkbox.label | translate: { dossiersCount: dossiersCount } }}
@@ -28,15 +25,7 @@ -
+
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html index 7087e823e..d0ae645aa 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html @@ -1,8 +1,5 @@
-
+
@@ -23,10 +20,7 @@ class="input-icon" >
@@ -34,20 +28,11 @@
-
- + diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index 274d9789f..37ce4623e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -47,15 +47,11 @@ export class EditColorDialogComponent { }; try { - await this._dictionaryControllerService - .setColors(colors, this._dossierTemplateId) - .toPromise(); + await this._dictionaryControllerService.setColors(colors, this._dossierTemplateId).toPromise(); this._dialogRef.close(true); this._notificationService.showToastNotification( this._translateService.instant('edit-color-dialog.success', { - color: this._translateService.instant( - 'default-colors-screen.types.' + this.colorKey - ) + color: this._translateService.instant('default-colors-screen.types.' + this.colorKey) }) ); } catch (e) { diff --git a/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html index 68f9dfa0b..e0d23d62e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html @@ -23,17 +23,9 @@ -
+
- + 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 752b959ac..ec2d30fd6 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 @@ -61,16 +61,7 @@ export class AuditScreenComponent { } private _updateDateFilters(value): boolean { - if ( - applyIntervalConstraints( - value, - this._previousFrom, - this._previousTo, - this.filterForm, - 'from', - 'to' - ) - ) { + if (applyIntervalConstraints(value, this._previousFrom, this._previousTo, this.filterForm, 'from', 'to')) { return true; } 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 e59658806..1d27cbb25 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 @@ -36,14 +36,7 @@ tooltipPosition="below" > - +
-
+
{{ dictionary.description }}
- + 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 1832c4977..0ebbfb000 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 @@ -29,10 +29,7 @@ export class DigitalSignatureScreenComponent { } get hasDigitalSignatureSet() { - return ( - this.digitalSignatureExists || - !!this.digitalSignatureForm.get('base64EncodedPrivateKey').value - ); + return this.digitalSignatureExists || !!this.digitalSignatureForm.get('base64EncodedPrivateKey').value; } saveDigitalSignature() { @@ -58,17 +55,13 @@ export class DigitalSignatureScreenComponent { error => { if (error.status === 400) { this._notificationService.showToastNotification( - this._translateService.instant( - 'digital-signature-screen.action.certificate-not-valid-error' - ), + this._translateService.instant('digital-signature-screen.action.certificate-not-valid-error'), null, NotificationType.ERROR ); } else { this._notificationService.showToastNotification( - this._translateService.instant( - 'digital-signature-screen.action.save-error' - ), + this._translateService.instant('digital-signature-screen.action.save-error'), null, NotificationType.ERROR ); @@ -82,9 +75,7 @@ export class DigitalSignatureScreenComponent { () => { this.loadDigitalSignatureAndInitializeForm(); this._notificationService.showToastNotification( - this._translateService.instant( - 'digital-signature-screen.action.delete-success' - ), + this._translateService.instant('digital-signature-screen.action.delete-success'), null, NotificationType.SUCCESS ); @@ -139,9 +130,7 @@ export class DigitalSignatureScreenComponent { certificateName: [this.digitalSignature.certificateName, Validators.required], contactInfo: this.digitalSignature.contactInfo, location: this.digitalSignature.location, - keySecret: this.digitalSignatureExists - ? null - : [this.digitalSignature.password, Validators.required], + keySecret: this.digitalSignatureExists ? null : [this.digitalSignature.password, Validators.required], reason: this.digitalSignature.reason, base64EncodedPrivateKey: this.digitalSignatureExists ? null diff --git a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html index 9a1ef08de..65a6079d4 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html @@ -8,12 +8,7 @@
- +
- {{ - 'license-info-screen.copyright-claim-text' - | translate: { currentYear: currentYear } - }} + {{ 'license-info-screen.copyright-claim-text' | translate: { currentYear: currentYear } }}
@@ -64,10 +56,7 @@ -
+
@@ -92,28 +81,18 @@
{{ currentInfo.numberOfAnalyzedPages }}
-
+
- {{ - 'license-info-screen.total-analyzed' - | translate: { date: totalInfo.startDate | date: 'longDate' } - }} + {{ 'license-info-screen.total-analyzed' | translate: { date: totalInfo.startDate | date: 'longDate' } }}
{{ totalInfo.numberOfAnalyzedPages }}
-
- {{ currentInfo.numberOfAnalyzedPages }} ({{ - analysisPercentageOfLicense | number: '1.0-2' - }}%) -
+
{{ currentInfo.numberOfAnalyzedPages }} ({{ analysisPercentageOfLicense | number: '1.0-2' }}%)
@@ -151,6 +130,4 @@
- + 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 7dbf54d26..1f5b2ba38 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 @@ -63,9 +63,7 @@ export class LicenseInformationScreenComponent implements OnInit { const unlicensedConfig = { startDate: endDate.toDate() }; - promises.push( - this._licenseReportController.licenseReport(unlicensedConfig).toPromise() - ); + promises.push(this._licenseReportController.licenseReport(unlicensedConfig).toPromise()); } Promise.all(promises).then(reports => { @@ -73,8 +71,7 @@ export class LicenseInformationScreenComponent implements OnInit { this.viewReady = true; this.analysisPercentageOfLicense = this.totalLicensedNumberOfPages > 0 - ? (this.currentInfo.numberOfAnalyzedPages / this.totalLicensedNumberOfPages) * - 100 + ? (this.currentInfo.numberOfAnalyzedPages / this.totalLicensedNumberOfPages) * 100 : 100; }); } @@ -92,9 +89,7 @@ export class LicenseInformationScreenComponent implements OnInit { pages: this.totalLicensedNumberOfPages }) ].join('%0D%0A'); - window.location.href = `mailto:${this.appConfigService.getConfig( - 'LICENSE_EMAIL' - )}?subject=${subject}&body=${body}`; + window.location.href = `mailto:${this.appConfigService.getConfig('LICENSE_EMAIL')}?subject=${subject}&body=${body}`; } private async _setMonthlyStats(startDate: moment.Moment, endDate: moment.Moment) { 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 1e7af3e05..8f266eebd 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 @@ -44,9 +44,7 @@ export class RulesScreenComponent extends ComponentHasChanges { private readonly _activatedRoute: ActivatedRoute ) { super(_translateService); - this._appStateService.activateDossierTemplate( - _activatedRoute.snapshot.params.dossierTemplateId - ); + this._appStateService.activateDossierTemplate(_activatedRoute.snapshot.params.dossierTemplateId); this._initialize(); } @@ -78,9 +76,7 @@ export class RulesScreenComponent extends ComponentHasChanges { @debounce() codeEditorTextChanged() { - const newDecorations = this.currentLines - .filter(entry => this._isNew(entry)) - .map(entry => this._makeDecorationFor(entry)); + const newDecorations = this.currentLines.filter(entry => this._isNew(entry)).map(entry => this._makeDecorationFor(entry)); this._decorations = this._codeEditor.deltaDecorations(this._decorations, newDecorations); } @@ -153,14 +149,12 @@ export class RulesScreenComponent extends ComponentHasChanges { } private _initialize() { - this._rulesControllerService - .downloadRules(this._appStateService.activeDossierTemplateId) - .subscribe( - rules => { - this.currentLines = this.initialLines = rules.rules.split('\n'); - this.revert(); - }, - () => (this.processing = false) - ); + this._rulesControllerService.downloadRules(this._appStateService.activeDossierTemplateId).subscribe( + rules => { + this.currentLines = this.initialLines = rules.rules.split('\n'); + this.revert(); + }, + () => (this.processing = false) + ); } } 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 a5d70e5b4..b36206694 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 @@ -79,51 +79,37 @@ export class SmtpConfigScreenComponent implements OnInit { async ngOnInit() { await this._loadData(); - this.generalSettings = await this._generalSettingsControllerService - .getGeneralConfigurations() - .toPromise(); + this.generalSettings = await this._generalSettingsControllerService.getGeneralConfigurations().toPromise(); this._initialGeneralSettings = Object.assign({}, this.generalSettings); } async save() { this.viewReady = false; - await this._smtpConfigService - .updateSMTPConfiguration(this.configForm.getRawValue()) - .toPromise(); + await this._smtpConfigService.updateSMTPConfiguration(this.configForm.getRawValue()).toPromise(); this._initialValue = this.configForm.getRawValue(); this.viewReady = true; } async saveGeneralConfig() { this.viewReady = false; - await this._generalSettingsControllerService - .updateGeneralConfigurations(this.generalSettings) - .toPromise(); + await this._generalSettingsControllerService.updateGeneralConfigurations(this.generalSettings).toPromise(); this.viewReady = true; } openAuthConfigDialog(skipDisableOnCancel?: boolean) { - this._dialogService.openDialog( - 'smtpAuthConfig', - null, - this.configForm.getRawValue(), - null, - authConfig => { - if (authConfig) { - this.configForm.patchValue(authConfig); - } else if (!skipDisableOnCancel) { - this.configForm.patchValue({ auth: false }, { emitEvent: false }); - } + this._dialogService.openDialog('smtpAuthConfig', null, this.configForm.getRawValue(), null, authConfig => { + if (authConfig) { + this.configForm.patchValue(authConfig); + } else if (!skipDisableOnCancel) { + this.configForm.patchValue({ auth: false }, { emitEvent: false }); } - ); + }); } async testConnection() { this.viewReady = false; try { - await this._smtpConfigService - .testSMTPConfiguration(this.configForm.getRawValue()) - .toPromise(); + await this._smtpConfigService.testSMTPConfiguration(this.configForm.getRawValue()).toPromise(); this._notificationService.showToastNotification( this._translateService.instant('smtp-config-screen.test.success'), undefined, @@ -142,9 +128,7 @@ export class SmtpConfigScreenComponent implements OnInit { private async _loadData() { try { - this._initialValue = await this._smtpConfigService - .getCurrentSMTPConfiguration() - .toPromise(); + this._initialValue = await this._smtpConfigService.getCurrentSMTPConfiguration().toPromise(); this.configForm.patchValue(this._initialValue, { emitEvent: false }); } catch (e) { } finally { 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 b5520c68d..a0c8c8036 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 @@ -50,24 +50,14 @@ export class AppConfigService { } loadAppConfig(): Observable { - this._cacheApiService - .getCachedValue(AppConfigKey.FRONTEND_APP_VERSION) - .then(async lastVersion => { - console.log( - '[REDACTION] Last app version: ', - lastVersion, - ' current version ', - this.version - ); - if (lastVersion !== this.version) { - console.log('[REDACTION] Version-missmatch - wiping caches!'); - await wipeCaches(); - } - await this._cacheApiService.cacheValue( - AppConfigKey.FRONTEND_APP_VERSION, - this.version - ); - }); + this._cacheApiService.getCachedValue(AppConfigKey.FRONTEND_APP_VERSION).then(async lastVersion => { + console.log('[REDACTION] Last app version: ', lastVersion, ' current version ', this.version); + if (lastVersion !== this.version) { + console.log('[REDACTION] Version-missmatch - wiping caches!'); + await wipeCaches(); + } + await this._cacheApiService.cacheValue(AppConfigKey.FRONTEND_APP_VERSION, this.version); + }); return this._httpClient.get('/assets/config/config.json').pipe( tap(config => { diff --git a/apps/red-ui/src/app/modules/auth/auth.module.ts b/apps/red-ui/src/app/modules/auth/auth.module.ts index 33336be2a..eead711f4 100644 --- a/apps/red-ui/src/app/modules/auth/auth.module.ts +++ b/apps/red-ui/src/app/modules/auth/auth.module.ts @@ -7,11 +7,7 @@ import { KeycloakAngularModule, KeycloakOptions, KeycloakService } from 'keycloa import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import { BASE_HREF } from '../../tokens'; -export function keycloakInitializer( - keycloak: KeycloakService, - appConfigService: AppConfigService, - baseUrl -) { +export function keycloakInitializer(keycloak: KeycloakService, appConfigService: AppConfigService, baseUrl) { return () => appConfigService .loadAppConfig() @@ -30,15 +26,12 @@ export function keycloakInitializer( initOptions: { checkLoginIframe: false, onLoad: 'check-sso', - silentCheckSsoRedirectUri: - window.location.origin + baseUrl + '/assets/oauth/silent-refresh.html', + silentCheckSsoRedirectUri: window.location.origin + baseUrl + '/assets/oauth/silent-refresh.html', flow: 'standard' }, enableBearerInterceptor: true }; - return keycloak - .init(options) - .then(() => configureAutomaticRedirectToLoginScreen(keycloak)); + return keycloak.init(options).then(() => configureAutomaticRedirectToLoginScreen(keycloak)); }); } 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 5c9c0d5d5..477957c94 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 @@ -27,10 +27,7 @@ export class RedRoleGuard implements CanActivate { if ( this._userService.user.isUserAdmin && !this._userService.user.isAdmin && - !( - state.url.startsWith('/main/admin/users') || - state.url.startsWith('/main/my-profile') - ) + !(state.url.startsWith('/main/admin/users') || state.url.startsWith('/main/my-profile')) ) { this._router.navigate(['/main/admin/users']); obs.next(false); 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 0a0f8fc96..4b2b05229 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 @@ -42,10 +42,7 @@ > - + { - this.annotation.comments.push({ - text: value, - id: commentResponse.commentId, - user: this._userService.userId - }); + this._manualAnnotationService.addComment(value, this.annotation.id).subscribe(commentResponse => { + this.annotation.comments.push({ + text: value, + id: commentResponse.commentId, + user: this._userService.userId }); + }); this.commentForm.reset(); } } @@ -54,14 +52,12 @@ export class CommentsComponent { } deleteComment(comment: Comment): void { - this._manualAnnotationService - .deleteComment(comment.id, this.annotation.id) - .subscribe(() => { - this.annotation.comments.splice(this.annotation.comments.indexOf(comment), 1); - if (!this.annotation.comments.length) { - this._hidden = true; - } - }); + this._manualAnnotationService.deleteComment(comment.id, this.annotation.id).subscribe(() => { + this.annotation.comments.splice(this.annotation.comments.indexOf(comment), 1); + if (!this.annotation.comments.length) { + this._hidden = true; + } + }); } isCommentOwner(comment: Comment): boolean { diff --git a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html index b45eaf546..0558d76b6 100644 --- a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html @@ -26,30 +26,20 @@
- {{ - 'file-preview.tabs.document-info.details.dossier' - | translate: { dossierName: dossier.name } - }} + {{ 'file-preview.tabs.document-info.details.dossier' | translate: { dossierName: dossier.name } }}
- {{ - 'file-preview.tabs.document-info.details.pages' - | translate: { pages: file.numberOfPages } - }} + {{ 'file-preview.tabs.document-info.details.pages' | translate: { pages: file.numberOfPages } }}
- {{ - 'file-preview.tabs.document-info.details.created-on' - | translate: { date: file.added | date: 'mediumDate' } - }} + {{ 'file-preview.tabs.document-info.details.created-on' | translate: { date: file.added | date: 'mediumDate' } }}
{{ - 'file-preview.tabs.document-info.details.due' - | translate: { date: dossier.dossier.dueDate | date: 'mediumDate' } + 'file-preview.tabs.document-info.details.due' | translate: { date: dossier.dossier.dueDate | date: 'mediumDate' } }}
diff --git a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.ts b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.ts index 754972a6e..72cd05668 100644 --- a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.ts @@ -14,10 +14,7 @@ export class DocumentInfoComponent { fileAttributesConfig: FileAttributesConfig; - constructor( - private readonly _appStateService: AppStateService, - private readonly _dialogService: DossiersDialogService - ) { + constructor(private readonly _appStateService: AppStateService, private readonly _dialogService: DossiersDialogService) { this.fileAttributesConfig = this._appStateService.activeFileAttributesConfig; } 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 ae58a0ab7..382643c84 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 @@ -16,9 +16,5 @@ type="dark-bg" > - +
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 dc7c5b5db..0f339b53a 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 @@ -1,9 +1,6 @@
- +
@@ -94,11 +91,7 @@ *ngIf="permissionsService.isReadyForApproval(fileStatus)" [disabled]="!permissionsService.canApprove(fileStatus)" [tooltipPosition]="tooltipPosition" - [tooltip]=" - permissionsService.canApprove(fileStatus) - ? 'dossier-overview.approve' - : 'dossier-overview.approve-disabled' - " + [tooltip]="permissionsService.canApprove(fileStatus) ? 'dossier-overview.approve' : 'dossier-overview.approve-disabled'" [type]="buttonType" icon="red:approved" > diff --git a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.html b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.html index 0a14004fe..dbf5b95fa 100644 --- a/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/needs-work-badge/needs-work-badge.component.html @@ -1,34 +1,14 @@
- - + + - - + + this.needsWorkInput).hasAnnotationComments - ); + return this.needsWorkInput instanceof FileStatusWrapper && (this.needsWorkInput).hasAnnotationComments; } reanalysisRequired() { diff --git a/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts index ef232df41..2570b45fb 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-indicator/page-indicator.component.ts @@ -1,13 +1,4 @@ -import { - Component, - EventEmitter, - Input, - OnChanges, - OnDestroy, - OnInit, - Output, - SimpleChanges -} from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { ViewedPages, ViewedPagesControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { PermissionsService } from '@services/permissions.service'; @@ -104,11 +95,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy { private _markPageRead() { this._viewedPagesControllerService - .addPage( - { page: this.number }, - this._appStateService.activeDossierId, - this._appStateService.activeFileId - ) + .addPage({ page: this.number }, this._appStateService.activeDossierId, this._appStateService.activeFileId) .subscribe(() => { this.viewedPages?.pages?.push(this.number); }); @@ -116,11 +103,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy { private _markPageUnread() { this._viewedPagesControllerService - .removePage( - this._appStateService.activeDossierId, - this._appStateService.activeFileId, - this.number - ) + .removePage(this._appStateService.activeDossierId, this._appStateService.activeFileId, this.number) .subscribe(() => { this.viewedPages?.pages?.splice(this.viewedPages?.pages?.indexOf(this.number), 1); }); diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.html b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.html index bcfbe8777..e20a2f31b 100644 --- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.html @@ -2,12 +2,7 @@
- +
-
- + 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 b6ff867e3..393998aaa 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 @@ -1,10 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { - FileAttributeConfig, - FileAttributesControllerService, - FileStatus -} from '@redaction/red-ui-http'; +import { FileAttributeConfig, FileAttributesControllerService, FileStatus } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DossierWrapper } from '@state/model/dossier.wrapper'; @@ -34,9 +30,7 @@ export class DocumentInfoDialogComponent implements OnInit { async ngOnInit() { this.attributes = ( - await this._fileAttributesService - .getFileAttributesConfiguration(this._dossier.dossierTemplateId) - .toPromise() + await this._fileAttributesService.getFileAttributesConfiguration(this._dossier.dossierTemplateId).toPromise() ).fileAttributeConfigs.filter(attr => attr.editable); const formConfig = this.attributes.reduce( (acc, attr) => ({ @@ -53,9 +47,7 @@ export class DocumentInfoDialogComponent implements OnInit { ...this.file.fileAttributes?.attributeIdToValue, ...this.documentInfoForm.getRawValue() }; - await this._fileAttributesService - .setFileAttributes({ attributeIdToValue }, this.file.dossierId, this.file.fileId) - .toPromise(); + await this._fileAttributesService.setFileAttributes({ attributeIdToValue }, this.file.dossierId, this.file.fileId).toPromise(); this.file.fileAttributes = { attributeIdToValue }; this.dialogRef.close(true); } 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 c98e77be4..445d8cd9e 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 @@ -12,26 +12,13 @@
- -
+
- + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/team-members/edit-dossier-team-members.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/team-members/edit-dossier-team-members.component.html index 530efedca..6fe380e42 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/team-members/edit-dossier-team-members.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/team-members/edit-dossier-team-members.component.html @@ -1,4 +1 @@ - + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html index feadb7245..845be9a24 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/force-redaction-dialog/force-redaction-dialog.component.html @@ -1,25 +1,16 @@
-
+
- + {{ option.label }} @@ -27,22 +18,12 @@
- +
- +
@@ -53,9 +34,5 @@
- +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index b62deb489..57c5ef08f 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -19,9 +19,7 @@
@@ -38,28 +36,15 @@
- +
- +
-
+
@@ -85,9 +70,5 @@
- + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html index a256d59de..fbcddfdd3 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html @@ -18,36 +18,17 @@
- +
- -
+
- + diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html index 9b9f80f93..aabddd419 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html @@ -49,9 +49,5 @@
- + 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 477033369..b00cf0589 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 @@ -21,44 +21,25 @@ export class AnnotationActionsService { private readonly _dialogService: DossiersDialogService ) {} - acceptSuggestion( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { + acceptSuggestion($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { $event?.stopPropagation(); annotations.forEach(annotation => { this._processObsAndEmit( - this._manualAnnotationService.approveRequest( - annotation.id, - annotation.isModifyDictionary - ), + this._manualAnnotationService.approveRequest(annotation.id, annotation.isModifyDictionary), annotation, annotationsChanged ); }); } - rejectSuggestion( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { + rejectSuggestion($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { $event?.stopPropagation(); annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.declineOrRemoveRequest(annotation), - annotation, - annotationsChanged - ); + this._processObsAndEmit(this._manualAnnotationService.declineOrRemoveRequest(annotation), annotation, annotationsChanged); }); } - forceRedaction( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { + forceRedaction($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { $event?.stopPropagation(); this._dialogService.openForceRedactionDialog($event, request => { annotations.forEach(annotation => { @@ -74,28 +55,16 @@ export class AnnotationActionsService { }); } - changeLegalBasis( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { - this._dialogService.openChangeLegalBasisDialog( - $event, - annotations, - (data: { comment: string; legalBasis: string }) => { - annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.changeLegalBasis( - annotation.annotationId, - data.legalBasis, - data.comment - ), - annotation, - annotationsChanged - ); - }); - } - ); + changeLegalBasis($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { + this._dialogService.openChangeLegalBasisDialog($event, annotations, (data: { comment: string; legalBasis: string }) => { + annotations.forEach(annotation => { + this._processObsAndEmit( + this._manualAnnotationService.changeLegalBasis(annotation.annotationId, data.legalBasis, data.comment), + annotation, + annotationsChanged + ); + }); + }); } suggestRemoveAnnotation( @@ -104,97 +73,55 @@ export class AnnotationActionsService { removeFromDictionary: boolean, annotationsChanged: EventEmitter ) { - this._dialogService.openRemoveFromDictionaryDialog( - $event, - annotations, - removeFromDictionary, - () => { - annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.removeOrSuggestRemoveAnnotation( - annotation, - removeFromDictionary - ), - annotation, - annotationsChanged - ); - }); - } - ); + this._dialogService.openRemoveFromDictionaryDialog($event, annotations, removeFromDictionary, () => { + annotations.forEach(annotation => { + this._processObsAndEmit( + this._manualAnnotationService.removeOrSuggestRemoveAnnotation(annotation, removeFromDictionary), + annotation, + annotationsChanged + ); + }); + }); } - markAsFalsePositive( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { + markAsFalsePositive($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { annotations.forEach(annotation => { const permissions = AnnotationPermissions.forUser( this._permissionsService.isApprover(), this._permissionsService.currentUser, annotation ); - const value = permissions.canMarkTextOnlyAsFalsePositive - ? annotation.value - : this._getFalsePositiveText(annotation); + const value = permissions.canMarkTextOnlyAsFalsePositive ? annotation.value : this._getFalsePositiveText(annotation); this._markAsFalsePositive($event, annotation, value, annotationsChanged); }); } - recategorizeImage( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { - this._dialogService.openRecategorizeImageDialog( - $event, - annotations, - (data: { type: string; comment: string }) => { - annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.recategorizeImage( - annotation.annotationId, - data.type, - data.comment - ), - annotation, - annotationsChanged - ); - }); - } - ); - } - - undoDirectAction( - $event: MouseEvent, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { - $event?.stopPropagation(); - - annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.undoRequest(annotation), - annotation, - annotationsChanged - ); + recategorizeImage($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { + this._dialogService.openRecategorizeImageDialog($event, annotations, (data: { type: string; comment: string }) => { + annotations.forEach(annotation => { + this._processObsAndEmit( + this._manualAnnotationService.recategorizeImage(annotation.annotationId, data.type, data.comment), + annotation, + annotationsChanged + ); + }); }); } - convertRecommendationToAnnotation( - $event: any, - annotations: AnnotationWrapper[], - annotationsChanged: EventEmitter - ) { + undoDirectAction($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { $event?.stopPropagation(); annotations.forEach(annotation => { - this._processObsAndEmit( - this._manualAnnotationService.addRecommendation(annotation), - annotation, - annotationsChanged - ); + this._processObsAndEmit(this._manualAnnotationService.undoRequest(annotation), annotation, annotationsChanged); + }); + } + + convertRecommendationToAnnotation($event: any, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { + $event?.stopPropagation(); + + annotations.forEach(annotation => { + this._processObsAndEmit(this._manualAnnotationService.addRecommendation(annotation), annotation, annotationsChanged); }); } @@ -206,15 +133,10 @@ export class AnnotationActionsService { const annotationPermissions = annotations.map(a => ({ annotation: a, - permissions: AnnotationPermissions.forUser( - this._permissionsService.isApprover(), - this._permissionsService.currentUser, - a - ) + permissions: AnnotationPermissions.forUser(this._permissionsService.isApprover(), this._permissionsService.currentUser, a) })); - const canRecategorizeImage = - annotations.length === 1 && annotationPermissions[0].permissions.canRecategorizeImage; + const canRecategorizeImage = annotations.length === 1 && annotationPermissions[0].permissions.canRecategorizeImage; if (canRecategorizeImage) { availableActions.push({ type: 'actionButton', @@ -236,9 +158,7 @@ export class AnnotationActionsService { availableActions.push({ type: 'actionButton', img: this._convertPath('/assets/icons/general/remove-from-dict.svg'), - title: this._translateService.instant( - 'annotation-actions.remove-annotation.remove-from-dict' - ), + title: this._translateService.instant('annotation-actions.remove-annotation.remove-from-dict'), onClick: () => { this._ngZone.run(() => { this.suggestRemoveAnnotation(null, annotations, true, annotationsChanged); @@ -247,33 +167,21 @@ export class AnnotationActionsService { }); } - const canAcceptRecommendation = annotationPermissions.reduce( - (acc, next) => acc && next.permissions.canAcceptRecommendation, - true - ); + const canAcceptRecommendation = annotationPermissions.reduce((acc, next) => acc && next.permissions.canAcceptRecommendation, true); if (canAcceptRecommendation) { availableActions.push({ type: 'actionButton', img: this._convertPath('/assets/icons/general/check.svg'), - title: this._translateService.instant( - 'annotation-actions.accept-recommendation.label' - ), + title: this._translateService.instant('annotation-actions.accept-recommendation.label'), onClick: () => { this._ngZone.run(() => { - this.convertRecommendationToAnnotation( - null, - annotations, - annotationsChanged - ); + this.convertRecommendationToAnnotation(null, annotations, annotationsChanged); }); } }); } - const canAcceptSuggestion = annotationPermissions.reduce( - (acc, next) => acc && next.permissions.canAcceptSuggestion, - true - ); + const canAcceptSuggestion = annotationPermissions.reduce((acc, next) => acc && next.permissions.canAcceptSuggestion, true); if (canAcceptSuggestion) { availableActions.push({ type: 'actionButton', @@ -287,10 +195,7 @@ export class AnnotationActionsService { }); } - const canUndo = annotationPermissions.reduce( - (acc, next) => acc && next.permissions.canUndo, - true - ); + const canUndo = annotationPermissions.reduce((acc, next) => acc && next.permissions.canUndo, true); if (canUndo) { availableActions.push({ type: 'actionButton', @@ -305,19 +210,14 @@ export class AnnotationActionsService { } const canMarkAsFalsePositive = annotationPermissions.reduce( - (acc, next) => - acc && - (next.permissions.canMarkAsFalsePositive || - next.permissions.canMarkTextOnlyAsFalsePositive), + (acc, next) => acc && (next.permissions.canMarkAsFalsePositive || next.permissions.canMarkTextOnlyAsFalsePositive), true ); if (canMarkAsFalsePositive) { availableActions.push({ type: 'actionButton', img: this._convertPath('/assets/icons/general/thumb-down.svg'), - title: this._translateService.instant( - 'annotation-actions.remove-annotation.false-positive' - ), + title: this._translateService.instant('annotation-actions.remove-annotation.false-positive'), onClick: () => { this._ngZone.run(() => { this.markAsFalsePositive(null, annotations, annotationsChanged); @@ -326,10 +226,7 @@ export class AnnotationActionsService { }); } - const canForceRedaction = annotationPermissions.reduce( - (acc, next) => acc && next.permissions.canForceRedaction, - true - ); + const canForceRedaction = annotationPermissions.reduce((acc, next) => acc && next.permissions.canForceRedaction, true); if (canForceRedaction) { availableActions.push({ type: 'actionButton', @@ -343,10 +240,7 @@ export class AnnotationActionsService { }); } - const canRejectSuggestion = annotationPermissions.reduce( - (acc, next) => acc && next.permissions.canRejectSuggestion, - true - ); + const canRejectSuggestion = annotationPermissions.reduce((acc, next) => acc && next.permissions.canRejectSuggestion, true); if (canRejectSuggestion) { availableActions.push({ type: 'actionButton', @@ -368,9 +262,7 @@ export class AnnotationActionsService { availableActions.push({ type: 'actionButton', img: this._convertPath('/assets/icons/general/trash.svg'), - title: this._translateService.instant( - 'annotation-actions.remove-annotation.only-here' - ), + title: this._translateService.instant('annotation-actions.remove-annotation.only-here'), onClick: () => { this._ngZone.run(() => { this.suggestRemoveAnnotation(null, annotations, false, annotationsChanged); @@ -382,11 +274,7 @@ export class AnnotationActionsService { return availableActions; } - private _processObsAndEmit( - obs: Observable, - annotation: AnnotationWrapper, - annotationsChanged: EventEmitter - ) { + private _processObsAndEmit(obs: Observable, annotation: AnnotationWrapper, annotationsChanged: EventEmitter) { obs.subscribe( () => { annotationsChanged.emit(annotation); @@ -426,11 +314,7 @@ export class AnnotationActionsService { falsePositiveRequest.addToDictionary = true; falsePositiveRequest.comment = { text: 'False Positive' }; - this._processObsAndEmit( - this._manualAnnotationService.addAnnotation(falsePositiveRequest), - annotation, - annotationsChanged - ); + this._processObsAndEmit(this._manualAnnotationService.addAnnotation(falsePositiveRequest), annotation, annotationsChanged); } private _convertPath(path: string): string { 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 68a4dca74..41b9d9b9c 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 @@ -1,11 +1,6 @@ import { Injectable } from '@angular/core'; import { Annotations, WebViewerInstance } from '@pdftron/webviewer'; -import { - Rectangle, - RedactionLogControllerService, - SectionGrid, - SectionRectangle -} from '@redaction/red-ui-http'; +import { Rectangle, RedactionLogControllerService, SectionGrid, SectionRectangle } from '@redaction/red-ui-http'; import { hexToRgb } from '@utils/functions'; import { AppStateService } from '@state/app-state.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; @@ -27,9 +22,7 @@ export class AnnotationDrawService { ) { const annotations = []; annotationWrappers.forEach(annotation => { - annotations.push( - this.computeAnnotation(activeViewer, annotation, hideSkipped, compareMode) - ); + annotations.push(this.computeAnnotation(activeViewer, annotation, hideSkipped, compareMode)); }); const annotationManager = activeViewer.annotManager; @@ -38,10 +31,7 @@ export class AnnotationDrawService { if (this._userPreferenceService.areDevFeaturesEnabled) { this._redactionLogControllerService - .getSectionGrid( - this._appStateService.activeDossierId, - this._appStateService.activeFileId - ) + .getSectionGrid(this._appStateService.activeDossierId, this._appStateService.activeFileId) .subscribe(sectionGrid => { this.drawSections(activeViewer, sectionGrid); }); @@ -53,9 +43,7 @@ export class AnnotationDrawService { for (const page of Object.keys(sectionGrid.rectanglesPerPage)) { const sectionRectangles: SectionRectangle[] = sectionGrid.rectanglesPerPage[page]; sectionRectangles.forEach(sectionRectangle => { - sections.push( - this.computeSection(activeViewer, parseInt(page, 10), sectionRectangle) - ); + sections.push(this.computeSection(activeViewer, parseInt(page, 10), sectionRectangle)); // sectionRectangle.tableCells?.forEach(cell =>{ // sections.push(this.computeSection(activeViewer, parseInt(page, 10), cell)); // }) @@ -66,11 +54,7 @@ export class AnnotationDrawService { annotationManager.drawAnnotationsFromList(sections); } - computeSection( - activeViewer: WebViewerInstance, - pageNumber: number, - sectionRectangle: SectionRectangle - ) { + computeSection(activeViewer: WebViewerInstance, pageNumber: number, sectionRectangle: SectionRectangle) { const rectangleAnnot = new activeViewer.Annotations.RectangleAnnotation(); const pageHeight = activeViewer.docViewer.getPageHeight(pageNumber); const rectangle = { @@ -97,44 +81,25 @@ export class AnnotationDrawService { hideSkipped: boolean = false, compareMode: boolean = false ) { - const pageNumber = compareMode - ? annotationWrapper.pageNumber * 2 - 1 - : annotationWrapper.pageNumber; + const pageNumber = compareMode ? annotationWrapper.pageNumber * 2 - 1 : annotationWrapper.pageNumber; const highlight = new activeViewer.Annotations.TextHighlightAnnotation(); highlight.PageNumber = pageNumber; - highlight.StrokeColor = this.getColor( - activeViewer, - annotationWrapper.superType, - annotationWrapper.dictionary - ); + highlight.StrokeColor = this.getColor(activeViewer, annotationWrapper.superType, annotationWrapper.dictionary); highlight.setContents(annotationWrapper.content); - highlight.Quads = this._rectanglesToQuads( - annotationWrapper.positions, - activeViewer, - pageNumber - ); + highlight.Quads = this._rectanglesToQuads(annotationWrapper.positions, activeViewer, pageNumber); highlight.Id = annotationWrapper.id; highlight.ReadOnly = true; // change log entries are drawn lighter highlight.Opacity = annotationWrapper.isChangeLogRemoved ? 0.2 : 1; - highlight.Hidden = - annotationWrapper.isChangeLogRemoved || - (hideSkipped && annotationWrapper.isSkipped) || - annotationWrapper.isOCR; + highlight.Hidden = annotationWrapper.isChangeLogRemoved || (hideSkipped && annotationWrapper.isSkipped) || annotationWrapper.isOCR; highlight.setCustomData('redacto-manager', true); highlight.setCustomData('redaction', annotationWrapper.isRedacted); highlight.setCustomData('skipped', annotationWrapper.isSkipped); highlight.setCustomData('changeLog', annotationWrapper.isChangeLogEntry); highlight.setCustomData('changeLogRemoved', annotationWrapper.isChangeLogRemoved); - highlight.setCustomData( - 'redactionColor', - this.getColor(activeViewer, 'redaction', 'redaction') - ); - highlight.setCustomData( - 'annotationColor', - this.getColor(activeViewer, annotationWrapper.superType, annotationWrapper.dictionary) - ); + highlight.setCustomData('redactionColor', this.getColor(activeViewer, 'redaction', 'redaction')); + highlight.setCustomData('annotationColor', this.getColor(activeViewer, annotationWrapper.superType, annotationWrapper.dictionary)); return highlight; } @@ -174,20 +139,12 @@ export class AnnotationDrawService { return new activeViewer.CoreControls.Math.Quad(x1, y1, x2, y2, x3, y3, x4, y4); } - private _rectanglesToQuads( - positions: Rectangle[], - activeViewer: WebViewerInstance, - pageNumber: number - ): any[] { + private _rectanglesToQuads(positions: Rectangle[], activeViewer: WebViewerInstance, pageNumber: number): any[] { const pageHeight = activeViewer.docViewer.getPageHeight(pageNumber); return positions.map(p => this._rectangleToQuad(p, activeViewer, pageHeight)); } - private _rectangleToQuad( - rectangle: Rectangle, - activeViewer: WebViewerInstance, - pageHeight: number - ): any { + private _rectangleToQuad(rectangle: Rectangle, activeViewer: WebViewerInstance, pageHeight: number): any { const x1 = rectangle.topLeft.x; const y1 = pageHeight - (rectangle.topLeft.y + rectangle.height); 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 d189d56fc..1cd4e3e57 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,8 +24,7 @@ export class AnnotationProcessingService { checked: false, topLevelFilter: true, filters: [], - checker: (annotation: AnnotationWrapper) => - annotation?.legalBasisChangeValue?.length > 0 + checker: (annotation: AnnotationWrapper) => annotation?.legalBasisChangeValue?.length > 0 } ]; } @@ -35,10 +34,7 @@ export class AnnotationProcessingService { const filters: FilterModel[] = []; annotations?.forEach(a => { - const topLevelFilter = - a.superType !== 'hint' && - a.superType !== 'redaction' && - a.superType !== 'recommendation'; + const topLevelFilter = a.superType !== 'hint' && a.superType !== 'redaction' && a.superType !== 'recommendation'; const key = topLevelFilter ? a.superType : a.superType + a.dictionary; const filter = filterMap.get(key); if (filter) { @@ -96,9 +92,7 @@ export class AnnotationProcessingService { if ( !this._matchesAll( secondaryFlatFilters, - f => - (!!f.checker && f.checker(annotation)) || - this._checkByFilterKey(f, annotation) + f => (!!f.checker && f.checker(annotation)) || this._checkByFilterKey(f, annotation) ) ) { continue; @@ -127,11 +121,7 @@ export class AnnotationProcessingService { return obj; } - private _createParentFilter( - key: string, - filterMap: Map, - filters: FilterModel[] - ) { + private _createParentFilter(key: string, filterMap: Map, filters: FilterModel[]) { const filter: FilterModel = { key: key, topLevelFilter: true, @@ -155,10 +145,7 @@ export class AnnotationProcessingService { return filterBy ? flatFilters.filter(f => filterBy(f)) : flatFilters; } - private _matchesOne = ( - filters: FilterModel[], - condition: (filter: FilterModel) => boolean - ): boolean => { + private _matchesOne = (filters: FilterModel[], condition: (filter: FilterModel) => boolean): boolean => { if (filters.length === 0) return true; for (const filter of filters) { @@ -168,10 +155,7 @@ export class AnnotationProcessingService { return false; }; - private _matchesAll = ( - filters: FilterModel[], - condition: (filter: FilterModel) => boolean - ): boolean => { + private _matchesAll = (filters: FilterModel[], condition: (filter: FilterModel) => boolean): boolean => { if (filters.length === 0) return true; for (const filter of filters) { @@ -183,13 +167,9 @@ export class AnnotationProcessingService { private _checkByFilterKey = (filter: FilterModel, annotation: AnnotationWrapper) => { const superType = annotation.superType; - const isNotTopLevelFilter = - superType === 'hint' || superType === 'redaction' || superType === 'recommendation'; + const isNotTopLevelFilter = superType === 'hint' || superType === 'redaction' || superType === 'recommendation'; - return ( - filter.key === superType || - (filter.key === annotation.dictionary && isNotTopLevelFilter) - ); + return filter.key === superType || (filter.key === annotation.dictionary && isNotTopLevelFilter); }; private _sortAnnotations(annotations: AnnotationWrapper[]): AnnotationWrapper[] { 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 3c6634fae..80f06622c 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 @@ -47,11 +47,7 @@ export class FileActionService { } } - assignDossierApprover( - file?: FileStatusWrapper, - callback?: Function, - ignoreDialogChanges = false - ) { + assignDossierApprover(file?: FileStatusWrapper, callback?: Function, ignoreDialogChanges = false) { this._dialogService.openAssignFileToUserDialog( file ? [file] : [this._appStateService.activeFile], 'approver', @@ -65,11 +61,7 @@ export class FileActionService { ); } - assignDossierReviewer( - file?: FileStatusWrapper, - callback?: Function, - ignoreDialogChanges = false - ) { + assignDossierReviewer(file?: FileStatusWrapper, callback?: Function, ignoreDialogChanges = false) { this._dialogService.openAssignFileToUserDialog( file ? [file] : [this._appStateService.activeFile], 'reviewer', @@ -88,10 +80,7 @@ export class FileActionService { fileStatus = [fileStatus]; } - const atLeastOneFileHasReviewer = fileStatus.reduce( - (acc, fs) => acc || !!fs.currentReviewer, - false - ); + const atLeastOneFileHasReviewer = fileStatus.reduce((acc, fs) => acc || !!fs.currentReviewer, false); if (atLeastOneFileHasReviewer) { this._dialogService.openAssignFileToMeDialog(async () => { await this._assignReviewerToCurrentUser(fileStatus, callback); @@ -148,22 +137,15 @@ export class FileActionService { } private _openAssignReviewerDialog(file?: FileStatusWrapper, callback?: Function) { - this._dialogService.openAssignFileToUserDialog( - file ? [file] : [this._appStateService.activeFile], - 'reviewer', - async () => { - await this._appStateService.reloadActiveDossierFiles(); - if (callback) { - callback(); - } + this._dialogService.openAssignFileToUserDialog(file ? [file] : [this._appStateService.activeFile], 'reviewer', async () => { + await this._appStateService.reloadActiveDossierFiles(); + if (callback) { + callback(); } - ); + }); } - private async _assignReviewerToCurrentUser( - fileStatus: FileStatusWrapper | FileStatusWrapper[], - callback?: Function - ) { + private async _assignReviewerToCurrentUser(fileStatus: FileStatusWrapper | FileStatusWrapper[], callback?: Function) { if (!isArray(fileStatus)) { fileStatus = [fileStatus]; } 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 990fd71c5..055e3670d 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 @@ -77,12 +77,7 @@ export class ManualAnnotationService { return obs.pipe( tap( () => this._notify(this._getMessage(mode)), - error => - this._notify( - this._getMessage(mode, modifyDictionary, true), - NotificationType.ERROR, - error - ) + error => this._notify(this._getMessage(mode, modifyDictionary, true), NotificationType.ERROR, error) ) ); } @@ -124,9 +119,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/legalBasisChange // /manualRedaction/request/legalBasis changeLegalBasis(annotationId: string, legalBasis: string, comment?: string) { - const mode: Mode = this._permissionsService.isApprover() - ? 'change-legal-basis' - : 'request-change-legal-basis'; + const mode: Mode = this._permissionsService.isApprover() ? 'change-legal-basis' : 'request-change-legal-basis'; return this._makeRequest(mode, { annotationId, legalBasis, comment }); } @@ -134,9 +127,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/recategorize // /manualRedaction/request/recategorize recategorizeImage(annotationId: string, type: string, comment: string) { - const mode: Mode = this._permissionsService.isApprover() - ? 'recategorize-image' - : 'request-image-recategorization'; + const mode: Mode = this._permissionsService.isApprover() ? 'recategorize-image' : 'request-image-recategorization'; return this._makeRequest(mode, { annotationId, type, comment }); } @@ -145,21 +136,14 @@ export class ManualAnnotationService { // /manualRedaction/request/add addAnnotation(manualRedactionEntry: AddRedactionRequest) { const mode: Mode = this._permissionsService.isApprover() ? 'add' : 'suggest'; - return this._makeRequest( - mode, - manualRedactionEntry, - null, - manualRedactionEntry.addToDictionary - ); + return this._makeRequest(mode, manualRedactionEntry, null, manualRedactionEntry.addToDictionary); } // this wraps // /manualRedaction/redaction/force // /manualRedaction/request/force forceRedaction(request: ForceRedactionRequest) { - const mode: Mode = this._permissionsService.isApprover() - ? 'force-redaction' - : 'request-force-redaction'; + const mode: Mode = this._permissionsService.isApprover() ? 'force-redaction' : 'request-force-redaction'; return this._makeRequest(mode, request); } @@ -167,21 +151,11 @@ export class ManualAnnotationService { // /manualRedaction/approve approveRequest(annotationId: string, addToDictionary: boolean = false) { // for only here - approve the request - return this._makeRequest( - 'approve', - { addOrRemoveFromDictionary: addToDictionary }, - annotationId, - addToDictionary - ); + return this._makeRequest('approve', { addOrRemoveFromDictionary: addToDictionary }, annotationId, addToDictionary); } undoRequest(annotationWrapper: AnnotationWrapper) { - return this._makeRequest( - 'undo', - annotationWrapper.id, - null, - annotationWrapper.isModifyDictionary - ); + return this._makeRequest('undo', annotationWrapper.id, null, annotationWrapper.isModifyDictionary); } // this wraps @@ -189,21 +163,13 @@ export class ManualAnnotationService { // /manualRedaction/undo declineOrRemoveRequest(annotationWrapper: AnnotationWrapper) { const mode: Mode = this._permissionsService.isApprover() ? 'decline' : 'undo'; - return this._makeRequest( - mode, - annotationWrapper.id, - null, - annotationWrapper.isModifyDictionary - ); + return this._makeRequest(mode, annotationWrapper.id, null, annotationWrapper.isModifyDictionary); } // this wraps // /manualRedaction/redaction/remove/ // /manualRedaction/request/remove/ - removeOrSuggestRemoveAnnotation( - annotationWrapper: AnnotationWrapper, - removeFromDictionary: boolean = false - ) { + removeOrSuggestRemoveAnnotation(annotationWrapper: AnnotationWrapper, removeFromDictionary: boolean = false) { let mode: Mode, body: any, removeDict = false; @@ -258,15 +224,10 @@ export class ManualAnnotationService { } private _notify(key: string, type: NotificationType = NotificationType.SUCCESS, data?: any) { - this._notificationService.showToastNotification( - this._translateService.instant(key, data), - null, - type, - { - positionClass: 'toast-file-preview', - actions: [] - } - ); + this._notificationService.showToastNotification(this._translateService.instant(key, data), null, type, { + positionClass: 'toast-file-preview', + actions: [] + }); } private _getMessage(mode: Mode, modifyDictionary?: boolean, error: boolean = false) { 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 64a9e00d5..d3f1bf249 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 @@ -37,9 +37,7 @@ export class PdfViewerDataService { this._man.getManualRedaction(dossierId, fileId).subscribe(); const file$ = this.downloadOriginalFile(this._appStateService.activeFile); - const reactionLog$ = this._redactionLogControllerService - .getRedactionLogPreview(dossierId, fileId) - .pipe(catchError(() => of({}))); + const reactionLog$ = this._redactionLogControllerService.getRedactionLogPreview(dossierId, fileId).pipe(catchError(() => of({}))); const redactionChangeLog$ = this._redactionLogControllerService .getRedactionChangeLog(dossierId, fileId) .pipe(catchError(() => of({}))); @@ -53,10 +51,7 @@ export class PdfViewerDataService { getViewedPagesForActiveFile() { if (this._permissionsService.canMarkPagesAsViewed()) { return this._viewedPagesControllerService - .getViewedPages( - this._appStateService.activeDossierId, - this._appStateService.activeFileId - ) + .getViewedPages(this._appStateService.activeDossierId, this._appStateService.activeFileId) .pipe(catchError(() => of({ pages: [] }))); } return of({ pages: [] }); diff --git a/apps/red-ui/src/app/modules/dossier/utils/compare-mode.utils.ts b/apps/red-ui/src/app/modules/dossier/utils/compare-mode.utils.ts index 24b130efb..f17133c9e 100644 --- a/apps/red-ui/src/app/modules/dossier/utils/compare-mode.utils.ts +++ b/apps/red-ui/src/app/modules/dossier/utils/compare-mode.utils.ts @@ -3,13 +3,7 @@ import { stampPDFPage } from '../../../utils/page-stamper'; const processPage = async (pageNumber, document1, document2, mergedDocument, PDFNet) => { const document1PageCount = await document1.getPageCount(); if (document1PageCount >= pageNumber) { - await mergedDocument.insertPages( - pageNumber * 2, - document1, - pageNumber, - pageNumber, - PDFNet.PDFDoc.InsertFlag.e_none - ); + await mergedDocument.insertPages(pageNumber * 2, document1, pageNumber, pageNumber, PDFNet.PDFDoc.InsertFlag.e_none); } else { const pageToCopy = await document2.getPage(pageNumber); const blankPage = await mergedDocument.pageCreate(await pageToCopy.getCropBox()); @@ -49,9 +43,7 @@ export const loadCompareDocumentWrapper = async ( await processPage(idx, compareDocument, currentDocument, mergedDocument, PDFNet); } - const buffer = await mergedDocument.saveMemoryBuffer( - PDFNet.SDFDoc.SaveOptions.e_linearized - ); + const buffer = await mergedDocument.saveMemoryBuffer(PDFNet.SDFDoc.SaveOptions.e_linearized); const mergedDocumentBuffer = new Blob([buffer], { type: 'application/pdf' diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index a8dace459..0b96e9b51 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -9,10 +9,7 @@ import { DomSanitizer } from '@angular/platform-browser'; exports: [MatIconModule] }) export class IconsModule { - constructor( - private readonly _iconRegistry: MatIconRegistry, - private readonly _sanitizer: DomSanitizer - ) { + constructor(private readonly _iconRegistry: MatIconRegistry, private readonly _sanitizer: DomSanitizer) { const icons = [ 'add', 'analyse', diff --git a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html index ebd73b821..59576c117 100644 --- a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html +++ b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.html @@ -27,10 +27,5 @@
- + diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html index 95bf94fb5..f16c8ed14 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html @@ -1,8 +1,4 @@ -
+
diff --git a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html index 39f6e5eda..6f8249aac 100644 --- a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html +++ b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.html @@ -1,9 +1,4 @@ -
+
diff --git a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts index 5c8f4e60a..1371ac55e 100644 --- a/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/checkbox/round-checkbox.component.ts @@ -1,12 +1,4 @@ -import { - Component, - ElementRef, - HostBinding, - Input, - OnChanges, - OnInit, - ViewChild -} from '@angular/core'; +import { Component, ElementRef, HostBinding, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; @Component({ selector: 'redaction-round-checkbox', diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html index 7b97cafac..22eb999b5 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html @@ -1,5 +1 @@ - + diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts index 2bffab9f9..3fc06e497 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts @@ -19,14 +19,8 @@ export class DictionaryAnnotationIconComponent implements OnChanges { ngOnChanges(): void { if (this.dictionaryKey) { - const typeValue: TypeValueWrapper = this._appStateService.getDictionaryTypeValue( - this.dictionaryKey, - this.dossierTemplateId - ); - this.color = this._appStateService.getDictionaryColor( - this.dictionaryKey, - this.dossierTemplateId - ); + const typeValue: TypeValueWrapper = this._appStateService.getDictionaryTypeValue(this.dictionaryKey, this.dossierTemplateId); + this.color = this._appStateService.getDictionaryColor(this.dictionaryKey, this.dossierTemplateId); this.type = typeValue.hint ? 'circle' : 'square'; this.label = this.dictionaryKey[0].toUpperCase(); } diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index 73a37074e..a6d438dcf 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -80,8 +80,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { .subscribe(entries => { this.diffEditorText = entries; this.showDiffEditor = true; - if (this.showDiffEditor) - this._diffEditor?.getOriginalEditor().setValue(this.diffEditorText); + if (this.showDiffEditor) this._diffEditor?.getOriginalEditor().setValue(this.diffEditorText); }); } @@ -136,9 +135,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { @debounce() codeEditorTextChanged() { - const newDecorations = this.currentEntries - .filter(entry => this._isNew(entry)) - .map(entry => this._getDecoration(entry)); + const newDecorations = this.currentEntries.filter(entry => this._isNew(entry)).map(entry => this._getDecoration(entry)); this._decorations = this._codeEditor.deltaDecorations(this._decorations, newDecorations); } @@ -162,13 +159,11 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { } private _applySearchDecorations() { - this._searchDecorations = - this._codeEditor?.deltaDecorations(this._searchDecorations, []) || []; + this._searchDecorations = this._codeEditor?.deltaDecorations(this._searchDecorations, []) || []; const decorations = this.findMatches.map(match => this._getSearchDecoration(match)); - this._searchDecorations = - this._codeEditor?.deltaDecorations(this._searchDecorations, decorations) || []; + this._searchDecorations = this._codeEditor?.deltaDecorations(this._searchDecorations, decorations) || []; } private _getMatches(text: string): FindMatch[] { @@ -199,15 +194,8 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { this._codeEditor.revealLineInCenter(range.startLineNumber, SMOOTH_SCROLL); } - private _onDossierChanged({ - dossierId, - dossierTemplateId - }: DossierWrapper): Observable { - const dictionary$ = this._dictionaryControllerService.getDictionaryForType( - dossierTemplateId, - 'dossier_redaction', - dossierId - ); + private _onDossierChanged({ dossierId, dossierTemplateId }: DossierWrapper): Observable { + const dictionary$ = this._dictionaryControllerService.getDictionaryForType(dossierTemplateId, 'dossier_redaction', dossierId); return dictionary$.pipe(map(data => this._toString(data.entries))); } diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts index 7cca79894..296f0219d 100644 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts @@ -1,12 +1,4 @@ -import { - ChangeDetectorRef, - Component, - EventEmitter, - Input, - OnChanges, - Output, - TemplateRef -} from '@angular/core'; +import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, TemplateRef } from '@angular/core'; import { FilterModel } from './model/filter.model'; import { handleCheckedValue } from './utils/filter-utils'; import { MAT_CHECKBOX_DEFAULT_OPTIONS } from '@angular/material/checkbox'; @@ -42,10 +34,7 @@ export class PopupFilterComponent implements OnChanges { atLeastOneFilterIsExpandable = false; atLeastOneSecondaryFilterIsExpandable = false; - constructor( - private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _translateService: TranslateService - ) {} + constructor(private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _translateService: TranslateService) {} get hasActiveFilters(): boolean { return !!this._allFilters.find(f => f.checked || f.indeterminate); @@ -57,9 +46,7 @@ export class PopupFilterComponent implements OnChanges { ngOnChanges(): void { this.atLeastOneFilterIsExpandable = !!this.primaryFilters?.find(f => this.isExpandable(f)); - this.atLeastOneSecondaryFilterIsExpandable = !!this.secondaryFilters?.find(f => - this.isExpandable(f) - ); + this.atLeastOneSecondaryFilterIsExpandable = !!this.secondaryFilters?.find(f => this.isExpandable(f)); } filterCheckboxClicked($event: any, filter: FilterModel, parent?: FilterModel) { 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 c2401b8a8..c7157206e 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 @@ -1,11 +1,4 @@ -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - Input, - OnChanges, - OnDestroy -} from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy } from '@angular/core'; import { UserService } from '@services/user.service'; import { User } from '@redaction/red-ui-http'; import { TranslateService } from '@ngx-translate/core'; diff --git a/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html index 61fb9d393..b8646c687 100644 --- a/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html +++ b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html @@ -1,9 +1,4 @@ -
+
|
| -
+
diff --git a/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts index b6ce6b86d..951c66126 100644 --- a/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts @@ -50,11 +50,7 @@ export class PaginationComponent { if (Math.max(1, this.currentPage - 1) > 1) { this.displayedPages.push('...'); } - for ( - let page = Math.max(1, this.currentPage - 1); - page <= Math.min(this.currentPage + 1, this.totalPages - 1); - ++page - ) { + for (let page = Math.max(1, this.currentPage - 1); page <= Math.min(this.currentPage + 1, this.totalPages - 1); ++page) { this.displayedPages.push(page); } if (Math.min(this.currentPage + 1, this.totalPages - 1) !== this.totalPages - 1) { diff --git a/apps/red-ui/src/app/modules/shared/components/select/select.component.html b/apps/red-ui/src/app/modules/shared/components/select/select.component.html index 64daca14b..0e8028605 100644 --- a/apps/red-ui/src/app/modules/shared/components/select/select.component.html +++ b/apps/red-ui/src/app/modules/shared/components/select/select.component.html @@ -1,26 +1,13 @@
{{ label }}
-
-
+
+
- + {{ translatePrefix + option | translate }} diff --git a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html index 577055adb..31ec0b241 100644 --- a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -23,10 +23,7 @@ -
+
{{ displayedDataTotal }}
{{ subtitle | translate }}
@@ -45,10 +42,7 @@ length: val.value, color: val.color, label: getLabel(val), - cssClass: - val.color === 'PROCESSING' || val.color === 'OCR_PROCESSING' - ? 'loading' - : '' + cssClass: val.color === 'PROCESSING' || val.color === 'OCR_PROCESSING' ? 'loading' : '' } ]" [small]="true" 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 a21012acd..24a90e150 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 @@ -86,9 +86,7 @@ export class SimpleDoughnutChartComponent implements OnChanges { } getLabel(config: DoughnutChartConfig): string { - return this.totalType === 'sum' - ? `${config.value} ${config.label}` - : `${config.label} (${config.value} ${this.counterText})`; + return this.totalType === 'sum' ? `${config.value} ${config.label}` : `${config.label} (${config.value} ${this.counterText})`; } selectValue(key: string) { diff --git a/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html index 02583b6bd..e06bd34f9 100644 --- a/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html +++ b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html @@ -1,9 +1,5 @@
-
+
-
@@ -27,9 +22,5 @@
- + diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index 403caff1f..764ff07f7 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -48,8 +48,7 @@ export class ConfirmationDialogComponent { ) { this.config = _confirmationDialogInput ?? new ConfirmationDialogInput(); this.config = this.translate(this.config); - this.inputLabel = - this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`; + this.inputLabel = this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`; } get isDeleteAction() { @@ -78,12 +77,9 @@ export class ConfirmationDialogComponent { translate(obj: T): T { const translateKeys = ['title', 'question', 'details', 'confirmationText', 'denyText']; - if (typeof obj === 'string') - return this._translateService.instant(obj, this.config.translateParams); + if (typeof obj === 'string') return this._translateService.instant(obj, this.config.translateParams); - const stringKeys = Object.keys(obj).filter( - key => typeof key === 'string' && !!obj[key] && translateKeys.includes(key) - ); + const stringKeys = Object.keys(obj).filter(key => typeof key === 'string' && !!obj[key] && translateKeys.includes(key)); stringKeys.forEach(key => (obj[key] = this.translate(obj[key]))); return obj; diff --git a/apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts b/apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts index 8fb57ac82..d0c832652 100644 --- a/apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts +++ b/apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts @@ -10,10 +10,7 @@ export class HasScrollbarDirective implements AfterContentChecked { constructor(private readonly _elementRef: ElementRef) {} get hasScrollbar() { - return ( - this._elementRef?.nativeElement.clientHeight < - this._elementRef?.nativeElement.scrollHeight - ); + return this._elementRef?.nativeElement.clientHeight < this._elementRef?.nativeElement.scrollHeight; } ngAfterContentChecked() { diff --git a/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts b/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts index 0f1b5f46b..2f6affe25 100644 --- a/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts +++ b/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts @@ -1,11 +1,4 @@ -import { - AfterViewInit, - Directive, - ElementRef, - HostListener, - Input, - OnDestroy -} from '@angular/core'; +import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core'; import { debounce } from '@utils/debounce'; @Directive({ @@ -32,9 +25,7 @@ export class SyncWidthDirective implements AfterViewInit, OnDestroy { @debounce(10) matchWidth() { const headerItems = this._elementRef.nativeElement.children; - const tableRows = this._elementRef.nativeElement.parentElement.getElementsByClassName( - this.redactionSyncWidth - ); + const tableRows = this._elementRef.nativeElement.parentElement.getElementsByClassName(this.redactionSyncWidth); if (!tableRows || !tableRows.length) { return; @@ -48,12 +39,8 @@ export class SyncWidthDirective implements AfterViewInit, OnDestroy { for (let idx = 0; idx < length - hasExtraColumns - 1; ++idx) { if (headerItems[idx]) { - headerItems[idx].style.width = `${ - tableRow.children[idx].getBoundingClientRect().width - }px`; - headerItems[idx].style.minWidth = `${ - tableRow.children[idx].getBoundingClientRect().width - }px`; + headerItems[idx].style.width = `${tableRow.children[idx].getBoundingClientRect().width}px`; + headerItems[idx].style.minWidth = `${tableRow.children[idx].getBoundingClientRect().width}px`; } } diff --git a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts index 4de9e5b87..fe9f71c85 100644 --- a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts @@ -10,20 +10,12 @@ const MINUTES_IN_AN_HOUR = 60; name: 'date' }) export class DatePipe extends BaseDatePipe implements PipeTransform { - constructor( - @Inject(LOCALE_ID) private readonly _locale: string, - private readonly _translateService: TranslateService - ) { + constructor(@Inject(LOCALE_ID) private readonly _locale: string, private readonly _translateService: TranslateService) { super(_locale); } transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null; - transform( - value: Date | string | number | null | undefined, - format?: string, - timezone?: string, - locale?: string - ): string | null; + transform(value: Date | string | number | null | undefined, format?: string, timezone?: string, locale?: string): string | null; transform(value: any, format?: string, timezone?: string, locale?: string): string { if (format === 'timeFromNow') return this._getTimeFromNow(value); return super.transform(value, format, timezone, locale); @@ -39,8 +31,7 @@ export class DatePipe extends BaseDatePipe implements PipeTransform { const minutesFromNow = date.diff(now, 'minutes'); const minutesLeft = minutesFromNow - HOURS_IN_A_DAY * MINUTES_IN_AN_HOUR * daysLeft; - if (daysLeft === 0 && hoursLeft === 0 && minutesLeft > 0) - return this._translate('time.less-than-an-hour'); + if (daysLeft === 0 && hoursLeft === 0 && minutesLeft > 0) return this._translate('time.less-than-an-hour'); const hoursSuffix = this._translate(`time.hour${hoursLeft === 1 ? '' : 's'}`); const hoursDisplay = `${hoursLeft} ${hoursSuffix}`; diff --git a/apps/red-ui/src/app/modules/shared/services/dialog.service.ts b/apps/red-ui/src/app/modules/shared/services/dialog.service.ts index d821b264c..1714cc862 100644 --- a/apps/red-ui/src/app/modules/shared/services/dialog.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/dialog.service.ts @@ -26,13 +26,7 @@ export abstract class DialogService { protected constructor(protected readonly _dialog: MatDialog) {} - openDialog( - type: T, - $event: MouseEvent, - data: any, - cb?: Function, - finallyCb?: Function - ): MatDialogRef { + openDialog(type: T, $event: MouseEvent, data: any, cb?: Function, finallyCb?: Function): MatDialogRef { const config = this._config[type]; $event?.stopPropagation(); diff --git a/apps/red-ui/src/app/modules/shared/services/filter.service.ts b/apps/red-ui/src/app/modules/shared/services/filter.service.ts index 172f17ef4..50d87d3ca 100644 --- a/apps/red-ui/src/app/modules/shared/services/filter.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/filter.service.ts @@ -1,9 +1,6 @@ import { ChangeDetectorRef, Injectable } from '@angular/core'; import { FilterModel } from '@shared/components/filters/popup-filter/model/filter.model'; -import { - getFilteredEntities, - processFilters -} from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { getFilteredEntities, processFilters } from '@shared/components/filters/popup-filter/utils/filter-utils'; import { FilterWrapper } from '@shared/components/filters/popup-filter/model/filter-wrapper.model'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { SearchService } from '@shared/services/search.service'; @@ -98,8 +95,7 @@ export class FilterService { } private _toFlatFilters(entities: FilterWrapper[]): FilterModel[] { - const flatChildren = (filters: FilterModel[]) => - (filters ?? []).reduce((acc, f) => [...acc, ...(f?.filters ?? [])], []); + const flatChildren = (filters: FilterModel[]) => (filters ?? []).reduce((acc, f) => [...acc, ...(f?.filters ?? [])], []); return entities.reduce((acc, f) => [...acc, ...f.values, ...flatChildren(f.values)], []); } diff --git a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts index 6c6c0d86d..d52457f7a 100644 --- a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts @@ -55,10 +55,7 @@ export class ScreenStateService { } get areAllEntitiesSelected(): boolean { - return ( - this.displayedEntities.length !== 0 && - this.selectedEntitiesIds.length === this.displayedEntities.length - ); + return this.displayedEntities.length !== 0 && this.selectedEntitiesIds.length === this.displayedEntities.length; } get areSomeEntitiesSelected$(): Observable { @@ -76,9 +73,7 @@ export class ScreenStateService { return this.setSelectedEntitiesIds([...this.selectedEntitiesIds, currentEntityId]); } - this.setSelectedEntitiesIds( - this.selectedEntitiesIds.filter((el, idx) => idx !== currentEntityIdx) - ); + this.setSelectedEntitiesIds(this.selectedEntitiesIds.filter((el, idx) => idx !== currentEntityIdx)); } toggleSelectAll(): void { diff --git a/apps/red-ui/src/app/modules/shared/services/search.service.ts b/apps/red-ui/src/app/modules/shared/services/search.service.ts index 49279535a..3098c3be3 100644 --- a/apps/red-ui/src/app/modules/shared/services/search.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/search.service.ts @@ -12,10 +12,7 @@ export class SearchService { query: [''] }); - constructor( - private readonly _screenStateService: ScreenStateService, - private readonly _formBuilder: FormBuilder - ) { + constructor(private readonly _screenStateService: ScreenStateService, private readonly _formBuilder: FormBuilder) { this.searchForm.valueChanges.subscribe(() => this.executeSearch()); } @@ -26,17 +23,14 @@ export class SearchService { } executeSearchImmediately(): void { - const displayed = - this._screenStateService.filteredEntities || this._screenStateService.entities; + const displayed = this._screenStateService.filteredEntities || this._screenStateService.entities; if (!this._searchKey) { return this._screenStateService.setDisplayedEntities(displayed); } this._screenStateService.setDisplayedEntities( - displayed.filter(entity => - this._searchField(entity).toLowerCase().includes(this._searchValue) - ) + displayed.filter(entity => this._searchField(entity).toLowerCase().includes(this._searchValue)) ); this._screenStateService.updateSelection(); } diff --git a/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts b/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts index feb65ed38..e045fab1e 100644 --- a/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts +++ b/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts @@ -15,13 +15,7 @@ import { FileDropOverlayService } from './services/file-drop-overlay.service'; imports: [CommonModule, SharedModule, OverlayModule], declarations: [FileDropComponent, UploadStatusOverlayComponent, OverwriteFilesDialogComponent], entryComponents: [FileDropComponent, UploadStatusOverlayComponent], - providers: [ - UploadDownloadDialogService, - FileUploadService, - FileDownloadService, - StatusOverlayService, - FileDropOverlayService - ], + providers: [UploadDownloadDialogService, FileUploadService, FileDownloadService, StatusOverlayService, FileDropOverlayService], exports: [FileDropComponent, UploadStatusOverlayComponent] }) export class FileUploadDownloadModule {} diff --git a/apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts b/apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts index 4c38d2973..9d1742de0 100644 --- a/apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts +++ b/apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts @@ -6,15 +6,8 @@ export class DownloadStatusWrapper { constructor(private _downloadStatus: DownloadStatus) {} get size() { - const i = - this._downloadStatus.fileSize === 0 - ? 0 - : Math.floor(Math.log(this._downloadStatus.fileSize) / Math.log(1024)); - return ( - (this._downloadStatus.fileSize / Math.pow(1024, i)).toFixed(2) + - ' ' + - ['B', 'kB', 'MB', 'GB', 'TB'][i] - ); + const i = this._downloadStatus.fileSize === 0 ? 0 : Math.floor(Math.log(this._downloadStatus.fileSize) / Math.log(1024)); + return (this._downloadStatus.fileSize / Math.pow(1024, i)).toFixed(2) + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; } get creationDate() { 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 9b7287ad3..4abf26af6 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 @@ -34,10 +34,7 @@ export class FileDownloadService { }); } - downloadFiles( - fileStatusWrappers: FileStatusWrapper[], - dossier: DossierWrapper - ): Observable { + downloadFiles(fileStatusWrappers: FileStatusWrapper[], dossier: DossierWrapper): Observable { return this._downloadControllerService .prepareDownload({ fileIds: fileStatusWrappers.map(f => f.fileId), @@ -49,9 +46,7 @@ export class FileDownloadService { getDownloadStatus() { return this._downloadControllerService.getDownloadStatus().pipe( tap(statusResponse => { - this.downloads = statusResponse.downloadStatus.map( - d => new DownloadStatusWrapper(d) - ); + this.downloads = statusResponse.downloadStatus.map(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 35e02614d..930bb3e96 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 @@ -42,25 +42,15 @@ export class FileDropOverlayService { }; initFileDropHandling() { - document - .getElementsByTagName('body')[0] - .addEventListener('dragenter', this.dragListener, false); - document - .getElementsByTagName('body')[0] - .addEventListener('mouseenter', this.mouseIn, false); + document.getElementsByTagName('body')[0].addEventListener('dragenter', this.dragListener, false); + document.getElementsByTagName('body')[0].addEventListener('mouseenter', this.mouseIn, false); document.getElementsByTagName('body')[0].addEventListener('mouseout', this.mouseOut, false); } cleanupFileDropHandling() { - document - .getElementsByTagName('body')[0] - .removeEventListener('dragenter', this.dragListener, false); - document - .getElementsByTagName('body')[0] - .removeEventListener('mouseenter', this.mouseIn, false); - document - .getElementsByTagName('body')[0] - .removeEventListener('mouseout', this.mouseOut, false); + document.getElementsByTagName('body')[0].removeEventListener('dragenter', this.dragListener, false); + document.getElementsByTagName('body')[0].removeEventListener('mouseenter', this.mouseIn, false); + document.getElementsByTagName('body')[0].removeEventListener('mouseout', this.mouseOut, false); } openFileDropOverlay() { diff --git a/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts b/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts index 091c8425b..2bd7148bd 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts @@ -12,11 +12,7 @@ export class StatusOverlayService { } openUploadStatusOverlay() { - const component = new ComponentPortal( - UploadStatusOverlayComponent, - null, - this._createUploadInjector() - ); + const component = new ComponentPortal(UploadStatusOverlayComponent, null, this._createUploadInjector()); if (!this._uploadStatusOverlayRef.hasAttached()) { this._uploadStatusOverlayRef.attach(component); } 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 c797e32d0..7e29b6ece 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 @@ -12,9 +12,7 @@ const dialogConfig = { export class UploadDownloadDialogService { constructor(private readonly _dialog: MatDialog) {} - openOverwriteFileDialog( - filename: string - ): Promise<{ option?: 'overwrite' | 'skip'; remember?: boolean; cancel?: boolean }> { + openOverwriteFileDialog(filename: string): Promise<{ option?: 'overwrite' | 'skip'; remember?: boolean; cancel?: boolean }> { const ref = this._dialog.open(OverwriteFilesDialogComponent, { ...dialogConfig, data: filename diff --git a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html index 060b49cf5..a4ecde75f 100644 --- a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html +++ b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html @@ -1,30 +1,17 @@
-
+
{{ 'upload-status.dialog.title' | translate: { len: uploadService.files.length } }}
- - + +
{{ uploadService.groupedFiles[dossierId][0].dossierName }}
-
+
-
+
this.fileRequiresReanalysis(file)).length > 0 - ); + return this.isApprover(dossier) && dossier.files.filter(file => this.fileRequiresReanalysis(file)).length > 0; } canToggleAnalysis(fileStatus: FileStatusWrapper): boolean { - return ( - this.isManager() && - ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status) - ); + return this.isManager() && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status); } canReanalyseFile(fileStatus = this._activeFile): boolean { return ( - (this.fileRequiresReanalysis(fileStatus) && - (this.isReviewerOrApprover(fileStatus) || fileStatus.isUnassigned)) || + (this.fileRequiresReanalysis(fileStatus) && (this.isReviewerOrApprover(fileStatus) || fileStatus.isUnassigned)) || (fileStatus.isError && fileStatus.isUnassigned) ); } @@ -77,21 +67,14 @@ export class PermissionsService { } canAssignToSelf(fileStatus = this._activeFile): boolean { - const precondition = - this.isDossierMember() && - !fileStatus.isProcessing && - !fileStatus.isError && - !fileStatus.isApproved; + const precondition = this.isDossierMember() && !fileStatus.isProcessing && !fileStatus.isError && !fileStatus.isApproved; const isTheOnlyReviewer = !this._appStateService.activeDossier.hasMoreThanOneReviewer; if (precondition) { if ( - (fileStatus.isUnassigned || - (fileStatus.isUnderReview && !this.isFileReviewer(fileStatus))) && - (this.isApprover() || - isTheOnlyReviewer || - (this.isDossierReviewer() && fileStatus.isUnassigned)) + (fileStatus.isUnassigned || (fileStatus.isUnderReview && !this.isFileReviewer(fileStatus))) && + (this.isApprover() || isTheOnlyReviewer || (this.isDossierReviewer() && fileStatus.isUnassigned)) ) { return true; } @@ -100,17 +83,10 @@ export class PermissionsService { } canAssignUser(fileStatus = this._activeFile): boolean { - const precondition = - !fileStatus.isProcessing && - !fileStatus.isError && - !fileStatus.isApproved && - this.isApprover(); + const precondition = !fileStatus.isProcessing && !fileStatus.isError && !fileStatus.isApproved && this.isApprover(); if (precondition) { - if ( - (fileStatus.isUnassigned || fileStatus.isUnderReview) && - this._activeDossier.hasMoreThanOneReviewer - ) { + if ((fileStatus.isUnassigned || fileStatus.isUnderReview) && this._activeDossier.hasMoreThanOneReviewer) { return true; } if (fileStatus.isUnderApproval && this._activeDossier.hasMoreThanOneApprover) { @@ -153,10 +129,7 @@ export class PermissionsService { } canPerformAnnotationActions(fileStatus = this._activeFile): boolean { - return ( - ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus?.status) && - this.isFileReviewer(fileStatus) - ); + return ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus?.status) && this.isFileReviewer(fileStatus); } canOpenFile(fileStatus = this._activeFile): boolean { @@ -172,10 +145,7 @@ export class PermissionsService { } canMarkPagesAsViewed(fileStatus = this._activeFile): boolean { - return ( - ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus?.status) && - this.isFileReviewer(fileStatus) - ); + return ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus?.status) && this.isFileReviewer(fileStatus); } canDownloadFiles(fileStatus = this._activeFile): boolean { @@ -203,9 +173,7 @@ export class PermissionsService { canOcrFile(fileStatus = this._activeFile): boolean { return ( - !fileStatus.isExcluded && - !fileStatus.ocrTime && - ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status) + !fileStatus.isExcluded && !fileStatus.ocrTime && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status) ); } @@ -218,9 +186,6 @@ export class PermissionsService { } canExcludePages(fileStatus = this._activeFile): boolean { - return ( - ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status) && - (this.isFileReviewer(fileStatus) || this.isApprover()) - ); + return ['UNDER_REVIEW', 'UNDER_APPROVAL'].includes(fileStatus.status) && (this.isFileReviewer(fileStatus) || this.isApprover()); } } 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 10ca5e383..5c9fbf827 100644 --- a/apps/red-ui/src/app/services/router-history.service.ts +++ b/apps/red-ui/src/app/services/router-history.service.ts @@ -9,13 +9,11 @@ export class RouterHistoryService { private _lastDossiersScreen = '/main/dossiers'; constructor(private readonly _router: Router) { - this._router.events - .pipe(filter(event => event instanceof NavigationEnd)) - .subscribe((event: NavigationEnd) => { - if (event.url.startsWith('/main/dossiers')) { - this._lastDossiersScreen = event.url; - } - }); + this._router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe((event: NavigationEnd) => { + if (event.url.startsWith('/main/dossiers')) { + this._lastDossiersScreen = event.url; + } + }); } navigateToLastDossiersScreen() { diff --git a/apps/red-ui/src/app/services/user.service.ts b/apps/red-ui/src/app/services/user.service.ts index bfc12b023..efddbf487 100644 --- a/apps/red-ui/src/app/services/user.service.ts +++ b/apps/red-ui/src/app/services/user.service.ts @@ -17,8 +17,7 @@ export class UserWrapper { name: string; constructor(private _currentUser: KeycloakProfile, public roles: string[], public id: string) { - this.name = - this.firstName && this.lastName ? `${this.firstName} ${this.lastName}` : this.username; + this.name = this.firstName && this.lastName ? `${this.firstName} ${this.lastName}` : this.username; } get username() { @@ -91,9 +90,7 @@ export class UserService { } get eligibleUsers(): User[] { - return this._allRedUsers.filter( - u => u.roles.indexOf('RED_USER') >= 0 || u.roles.indexOf('RED_MANAGER') >= 0 - ); + return this._allRedUsers.filter(u => u.roles.indexOf('RED_USER') >= 0 || u.roles.indexOf('RED_MANAGER') >= 0); } get user() { @@ -154,9 +151,7 @@ export class UserService { } getName(user?: User) { - return user?.firstName && user?.lastName - ? `${user.firstName} ${user.lastName}` - : user?.username; + return user?.firstName && user?.lastName ? `${user.firstName} ${user.lastName}` : user?.username; } isManager(user: User | UserWrapper = this.user): boolean { 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 03e251741..4956972b8 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -160,27 +160,15 @@ export class AppStateService { } private static _isFileOverviewRoute(event: Event) { - return ( - event instanceof ResolveStart && - event.url.includes('/main/dossiers/') && - event.url.includes('/file/') - ); + return event instanceof ResolveStart && event.url.includes('/main/dossiers/') && event.url.includes('/file/'); } private static _isDossierOverviewRoute(event: Event) { - return ( - event instanceof ResolveStart && - event.url.includes('/main/dossiers/') && - !event.url.includes('/file/') - ); + return event instanceof ResolveStart && event.url.includes('/main/dossiers/') && !event.url.includes('/file/'); } private static _isRandomRoute(event: Event) { - return ( - event instanceof NavigationEnd && - !event.url.includes('/main/dossiers/') && - !event.url.includes('/file/') - ); + return event instanceof NavigationEnd && !event.url.includes('/main/dossiers/') && !event.url.includes('/file/'); } async reloadActiveDossierFilesIfNecessary() { @@ -194,10 +182,7 @@ export class AppStateService { dossierTemplateId = this.activeDossier.dossierTemplateId; } if (!dossierTemplateId) { - dossierTemplateId = - this.dossierTemplates.length > 0 - ? this.dossierTemplates[0].dossierTemplateId - : undefined; + dossierTemplateId = this.dossierTemplates.length > 0 ? this.dossierTemplates[0].dossierTemplateId : undefined; } if (!dossierTemplateId) { return undefined; @@ -216,10 +201,7 @@ export class AppStateService { } if (!dossierTemplateId) { - dossierTemplateId = - this.dossierTemplates.length > 0 - ? this.dossierTemplates[0].dossierTemplateId - : undefined; + dossierTemplateId = this.dossierTemplates.length > 0 ? this.dossierTemplates[0].dossierTemplateId : undefined; } if (!dossierTemplateId) { return undefined; @@ -240,13 +222,9 @@ export class AppStateService { 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)) - ); + const mappedDossiers = dossiers.map(p => new DossierWrapper(p, this._getExistingFiles(p.dossierId))); - const fileData = await this._statusControllerService - .getFileStatusForDossiers(mappedDossiers.map(p => p.dossierId)) - .toPromise(); + const fileData = await this._statusControllerService.getFileStatusForDossiers(mappedDossiers.map(p => p.dossierId)).toPromise(); for (const dossierId of Object.keys(fileData)) { const dossier = mappedDossiers.find(p => p.dossierId === dossierId); @@ -263,9 +241,7 @@ export class AppStateService { return null; } const oldProcessedDate = this.activeFile.lastProcessed; - const activeFile = await this._statusControllerService - .getFileStatus(this.activeDossierId, this.activeFileId) - .toPromise(); + const activeFile = await this._statusControllerService.getFileStatus(this.activeDossierId, this.activeFileId).toPromise(); const activeFileWrapper = new FileStatusWrapper( activeFile, @@ -289,9 +265,7 @@ export class AppStateService { if (!dossier) { dossier = this.activeDossier; } - const files = await this._statusControllerService - .getDossierStatus(dossier.dossierId) - .toPromise(); + const files = await this._statusControllerService.getDossierStatus(dossier.dossierId).toPromise(); return this._processFiles(dossier, files, emitEvents); } @@ -317,21 +291,18 @@ export class AppStateService { updateDossierDictionary(dossierTemplateId: string, dossierId: string) { // dossier exists, load it's dictionary - this._dictionaryControllerService - .getDictionaryForType(dossierTemplateId, 'dossier_redaction', dossierId) - .subscribe( - typeData => { - this.activeDossier.type = typeData; - }, - () => { - this.activeDossier.type = null; - } - ); + this._dictionaryControllerService.getDictionaryForType(dossierTemplateId, 'dossier_redaction', dossierId).subscribe( + typeData => { + this.activeDossier.type = typeData; + }, + () => { + this.activeDossier.type = null; + } + ); } activateFile(dossierId: string, fileId: string) { - if (this._appState.activeDossierId === dossierId && this._appState.activeFileId === fileId) - return; + if (this._appState.activeDossierId === dossierId && this._appState.activeFileId === fileId) return; this.activateDossier(dossierId); if (this.activeDossier) { this._appState.activeFileId = fileId; @@ -357,9 +328,7 @@ export class AppStateService { this._appState.activeDictionaryType = dictionaryType; if (!this.activeDictionary) { this._appState.activeDictionaryType = null; - this._router.navigate([ - '/main/admin/dossier-templates/' + this.activeDossierTemplateId - ]); + this._router.navigate(['/main/admin/dossier-templates/' + this.activeDossierTemplateId]); } } } @@ -377,9 +346,7 @@ export class AppStateService { .toPromise() .then( () => { - const index = this._appState.dossiers.findIndex( - p => p.dossier.dossierId === dossier.dossierId - ); + const index = this._appState.dossiers.findIndex(p => p.dossier.dossierId === dossier.dossierId); this._appState.dossiers.splice(index, 1); this._appState.dossiers = [...this._appState.dossiers]; }, @@ -395,12 +362,8 @@ export class AppStateService { async addOrUpdateDossier(dossier: Dossier) { try { - const updatedDossier = await this._dossierControllerService - .createOrUpdateDossier(dossier) - .toPromise(); - let foundDossier = this._appState.dossiers.find( - p => p.dossier.dossierId === updatedDossier.dossierId - ); + const updatedDossier = await this._dossierControllerService.createOrUpdateDossier(dossier).toPromise(); + let foundDossier = this._appState.dossiers.find(p => p.dossier.dossierId === updatedDossier.dossierId); if (foundDossier) { Object.assign((foundDossier.dossier = updatedDossier)); } else { @@ -412,9 +375,7 @@ export class AppStateService { } catch (error) { this._notificationService.showToastNotification( this._translateService.instant( - error.status === 409 - ? 'add-dossier-dialog.errors.dossier-already-exists' - : 'add-dossier-dialog.errors.generic' + error.status === 409 ? 'add-dossier-dialog.errors.dossier-already-exists' : 'add-dossier-dialog.errors.generic' ), null, NotificationType.ERROR @@ -429,19 +390,14 @@ export class AppStateService { } async loadAllDossierTemplates() { - const dossierTemplates = await this._dossierTemplateControllerService - .getAllDossierTemplates() - .toPromise(); - this._appState.dossierTemplates = dossierTemplates.map( - dossierTemplate => new DossierTemplateModelWrapper(dossierTemplate) - ); + const dossierTemplates = await this._dossierTemplateControllerService.getAllDossierTemplates().toPromise(); + this._appState.dossierTemplates = dossierTemplates.map(dossierTemplate => new DossierTemplateModelWrapper(dossierTemplate)); this._appState.fileAttributesConfig = {}; for (const dossierTemplate of this._appState.dossierTemplates) { - this._appState.fileAttributesConfig[dossierTemplate.dossierTemplateId] = - await this._fileAttributesService - .getFileAttributesConfiguration(dossierTemplate.dossierTemplateId) - .pipe(catchError(() => of({}))) - .toPromise(); + this._appState.fileAttributesConfig[dossierTemplate.dossierTemplateId] = await this._fileAttributesService + .getFileAttributesConfiguration(dossierTemplate.dossierTemplateId) + .pipe(catchError(() => of({}))) + .toPromise(); } } @@ -465,10 +421,7 @@ export class AppStateService { } } - getDictionaryDataForDossierTemplateObservables( - dossierTemplateId: string, - dictionaryData: { [key: string]: any } - ): Observable[] { + getDictionaryDataForDossierTemplateObservables(dossierTemplateId: string, dictionaryData: { [key: string]: any }): Observable[] { const typeObs = this._dictionaryControllerService.getAllTypes(dossierTemplateId).pipe( tap(typesResponse => { for (const type of typesResponse.types) { @@ -704,11 +657,7 @@ export class AppStateService { return found ? found.files : []; } - private _processFiles( - dossier: DossierWrapper, - files: FileStatus[], - emitEvents: boolean = true - ) { + private _processFiles(dossier: DossierWrapper, files: FileStatus[], emitEvents: boolean = true) { const oldFiles = [...dossier.files]; const fileStatusChangedEvent = []; 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 4220c3614..e859c8dff 100644 --- a/apps/red-ui/src/app/state/model/dossier.wrapper.ts +++ b/apps/red-ui/src/app/state/model/dossier.wrapper.ts @@ -124,8 +124,7 @@ export class DossierWrapper { this.hasRequests = this.hasRequests || f.hasRequests; this.allFilesApproved = this.allFilesApproved && f.isApproved; this.totalNumberOfPages += f.numberOfPages; - this.hasPendingOrProcessing = - this.hasPendingOrProcessing || f.isPending || f.isProcessing; + this.hasPendingOrProcessing = this.hasPendingOrProcessing || f.isPending || f.isProcessing; }); this.hasNone = !this.hasRequests && !this.hasRedactions && !this.hintsOnly; } diff --git a/apps/red-ui/src/app/utils/api-path-interceptor.ts b/apps/red-ui/src/app/utils/api-path-interceptor.ts index 78ae4a1f6..61d262e22 100644 --- a/apps/red-ui/src/app/utils/api-path-interceptor.ts +++ b/apps/red-ui/src/app/utils/api-path-interceptor.ts @@ -6,10 +6,7 @@ import { BASE_HREF } from '../tokens'; @Injectable() export class ApiPathInterceptor implements HttpInterceptor { - constructor( - @Inject(BASE_HREF) private readonly _baseHref: string, - private readonly _appConfigService: AppConfigService - ) {} + constructor(@Inject(BASE_HREF) private readonly _baseHref: string, private readonly _appConfigService: AppConfigService) {} intercept(req: HttpRequest, next: HttpHandler): Observable> { if (!req.url.startsWith('/assets')) { 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 4b85cdbbb..d41a1190f 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 @@ -59,17 +59,12 @@ export class CustomRouteReuseStrategy implements RouteReuseStrategy { } shouldReuseRoute(future: ActivatedRouteSnapshot, current: ActivatedRouteSnapshot): boolean { - return ( - future.routeConfig === current.routeConfig || - this._getKey(future) === this._getKey(current) - ); + return future.routeConfig === current.routeConfig || this._getKey(future) === this._getKey(current); } private _getKey(route: ActivatedRouteSnapshot): string { return route.pathFromRoot - .map((el: ActivatedRouteSnapshot) => - el.routeConfig ? el.routeConfig.path + JSON.stringify(el.params) : '' - ) + .map((el: ActivatedRouteSnapshot) => (el.routeConfig ? el.routeConfig.path + JSON.stringify(el.params) : '')) .filter(str => str.length > 0) .join(''); } diff --git a/apps/red-ui/src/app/utils/dialog-helper.ts b/apps/red-ui/src/app/utils/dialog-helper.ts index e8f3940c4..653b86897 100644 --- a/apps/red-ui/src/app/utils/dialog-helper.ts +++ b/apps/red-ui/src/app/utils/dialog-helper.ts @@ -59,22 +59,14 @@ export class DialogHelper { config.backdropClass = 'dark-backdrop'; config.panelClass = 'gin-file-upload-dialog-panel'; config.scrollStrategy = overlay.scrollStrategies.block(); - config.positionStrategy = overlay - .position() - .global() - .centerHorizontally() - .centerVertically(); + config.positionStrategy = overlay.position().global().centerHorizontally().centerVertically(); return config; } static generateUploadStatusConfig(overlay: Overlay): OverlayConfig { const config = new OverlayConfig(); config.hasBackdrop = false; - config.positionStrategy = overlay - .position() - .global() - .bottom(DialogHelper._MARGIN) - .right(DialogHelper._MARGIN); + config.positionStrategy = overlay.position().global().bottom(DialogHelper._MARGIN).right(DialogHelper._MARGIN); return config; } } diff --git a/apps/red-ui/src/app/utils/file-download-utils.ts b/apps/red-ui/src/app/utils/file-download-utils.ts index 8f793588c..038357ab9 100644 --- a/apps/red-ui/src/app/utils/file-download-utils.ts +++ b/apps/red-ui/src/app/utils/file-download-utils.ts @@ -5,9 +5,7 @@ export function download(event: HttpResponse, altName?: string) { const contentDisposition = event.headers.get('Content-Disposition'); let fileName; try { - fileName = contentDisposition - ? contentDisposition.split('filename=')[1].replace(/"/g, '') - : undefined; + fileName = contentDisposition ? contentDisposition.split('filename=')[1].replace(/"/g, '') : undefined; } catch (e) { console.log('[REDACTION] Failed to parse content-disposition: ', contentDisposition); } 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 578b09fa8..ca8a871fc 100644 --- a/apps/red-ui/src/app/utils/file-drop-utils.ts +++ b/apps/red-ui/src/app/utils/file-drop-utils.ts @@ -1,11 +1,7 @@ import { FileUploadModel } from '@upload-download/model/file-upload.model'; import { DossierWrapper } from '@state/model/dossier.wrapper'; -export function handleFileDrop( - event: DragEvent, - dossier: DossierWrapper, - uploadFiles: (files: FileUploadModel[]) => void -) { +export function handleFileDrop(event: DragEvent, dossier: DossierWrapper, uploadFiles: (files: FileUploadModel[]) => void) { event.preventDefault(); event.stopPropagation(); const { dataTransfer } = event; @@ -31,10 +27,7 @@ export function handleFileDrop( } export function isCsv(file: FileUploadModel): boolean { - return ( - file.file.type?.toLowerCase() === 'text/csv' || - file.file.name.toLowerCase().endsWith('.csv') - ); + return file.file.type?.toLowerCase() === 'text/csv' || file.file.name.toLowerCase().endsWith('.csv'); } export function convertFiles(files: FileList | File[], dossier: DossierWrapper): FileUploadModel[] { diff --git a/apps/red-ui/src/app/utils/page-stamper.ts b/apps/red-ui/src/app/utils/page-stamper.ts index e2c444ae5..16611e565 100644 --- a/apps/red-ui/src/app/utils/page-stamper.ts +++ b/apps/red-ui/src/app/utils/page-stamper.ts @@ -25,9 +25,7 @@ export async function stampPDFPage( const rgbColor = hexToRgb(color); const stamper = await PdfNet.Stamper.create(3, fontSize, 0); - await stamper.setFontColor( - await PdfNet.ColorPt.init(rgbColor.r / 255, rgbColor.g / 255, rgbColor.b / 255) - ); + await stamper.setFontColor(await PdfNet.ColorPt.init(rgbColor.r / 255, rgbColor.g / 255, rgbColor.b / 255)); await stamper.setOpacity(opacity / 100); switch (orientation) { diff --git a/apps/red-ui/src/app/utils/sorters/redaction-filter-sorter.ts b/apps/red-ui/src/app/utils/sorters/redaction-filter-sorter.ts index a922c6820..82e055c3b 100644 --- a/apps/red-ui/src/app/utils/sorters/redaction-filter-sorter.ts +++ b/apps/red-ui/src/app/utils/sorters/redaction-filter-sorter.ts @@ -6,6 +6,5 @@ export const RedactionFilterSorter = { hint: 4, suggestion: 5, none: 6, - byKey: (a: { key: string }, b: { key: string }) => - RedactionFilterSorter[a.key] - RedactionFilterSorter[b.key] + byKey: (a: { key: string }, b: { key: string }) => RedactionFilterSorter[a.key] - RedactionFilterSorter[b.key] }; diff --git a/apps/red-ui/src/app/utils/sync-scroll.ts b/apps/red-ui/src/app/utils/sync-scroll.ts index 50e90757e..51a462699 100644 --- a/apps/red-ui/src/app/utils/sync-scroll.ts +++ b/apps/red-ui/src/app/utils/sync-scroll.ts @@ -36,12 +36,7 @@ export function syncScroll(elements: HTMLElement[]) { updateX && Math.round( otherEl['scrollLeft'] - - (scrollX = otherEl.eX = - Math.round( - xRate * - (otherEl['scrollWidth'] - - otherEl['clientWidth']) - )) + (scrollX = otherEl.eX = Math.round(xRate * (otherEl['scrollWidth'] - otherEl['clientWidth']))) ) ) { otherEl['scrollLeft'] = scrollX; @@ -51,12 +46,7 @@ export function syncScroll(elements: HTMLElement[]) { updateY && Math.round( otherEl['scrollTop'] - - (scrollY = otherEl.eY = - Math.round( - yRate * - (otherEl['scrollHeight'] - - otherEl['clientHeight']) - )) + (scrollY = otherEl.eY = Math.round(yRate * (otherEl['scrollHeight'] - otherEl['clientHeight']))) ) ) { otherEl['scrollTop'] = scrollY; diff --git a/apps/red-ui/src/app/utils/uuid-helper.ts b/apps/red-ui/src/app/utils/uuid-helper.ts index 0f925537b..3cd05d407 100644 --- a/apps/red-ui/src/app/utils/uuid-helper.ts +++ b/apps/red-ui/src/app/utils/uuid-helper.ts @@ -5,9 +5,7 @@ for (let i = 0; i < 256; i++) { } export function isUUID(uuid: string) { - return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test( - uuid - ); + return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(uuid); } export function UUID() { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 706acba0d..987fe13a8 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -7,10 +7,6 @@ "title": "" } }, - "": { - "": "", - "title": "" - }, "actions": { "all": "", "none": "" @@ -156,6 +152,9 @@ "categories": { "": "" }, + "no-data": { + "title": "" + }, "table-col-names": { "category": "", "date": "", @@ -225,6 +224,13 @@ "dev-mode": "", "dictionary-listing": { "case-sensitive": "", + "no-data": { + "action": "", + "title": "" + }, + "no-match": { + "title": "" + }, "stats": { "charts": { "entries": "" @@ -279,6 +285,10 @@ "label": "", "placeholder": "" }, + "no-data": { + "action": "", + "title": "" + }, "password": { "label": "", "placeholder": "" @@ -293,6 +303,13 @@ "title": "" }, "dossier-attributes-listing": { + "no-data": { + "action": "", + "title": "" + }, + "no-match": { + "title": "" + }, "table-col-names": { "label": "", "type": "" @@ -314,6 +331,13 @@ }, "dossier-listing": { "add-new": "", + "no-data": { + "action": "", + "title": "" + }, + "no-match": { + "title": "" + }, "quick-filters": { "my-dossiers": "", "other": "", @@ -370,6 +394,13 @@ } } }, + "no-data": { + "action": "", + "title": "" + }, + "no-match": { + "title": "" + }, "ocr-performed": "", "quick-filters": { "assigned-to-me": "", @@ -398,6 +429,12 @@ "dossier-templates": "", "dossier-templates-listing": { "dictionaries": "", + "no-data": { + "title": "" + }, + "no-match": { + "title": "" + }, "table-col-names": { "created-by": "", "created-on": "", @@ -421,6 +458,9 @@ "label": "" }, "downloads-list": { + "no-data": { + "title": "" + }, "table-col-names": { "date": "", "name": "", @@ -488,6 +528,9 @@ "file": "", "key-column": "", "key-column-placeholder": "", + "no-data": { + "title": "" + }, "no-hovered-column": "", "no-sample-data-for": "", "quick-activation": { @@ -518,6 +561,12 @@ "total-rows": "" }, "file-attributes-listing": { + "no-data": { + "title": "" + }, + "no-match": { + "title": "" + }, "read-only": "", "table-col-names": { "csv-column": "", @@ -537,6 +586,9 @@ "delta-tooltip": "", "excluded-from-redaction": "", "last-reviewer": "", + "no-data": { + "title": "" + }, "quick-nav": { "jump-first": "", "jump-last": "" @@ -808,6 +860,12 @@ "restore": "" }, "label": "", + "no-data": { + "title": "" + }, + "no-match": { + "title": "" + }, "table-col-names": { "deleted-on": "", "name": "", @@ -828,6 +886,9 @@ } }, "user-listing": { + "no-match": { + "title": "" + }, "table-col-names": { "active": "", "email": "", diff --git a/libs/red-cache/.eslintrc.json b/libs/red-cache/.eslintrc.json index 34f0525ad..cf4ef48a5 100644 --- a/libs/red-cache/.eslintrc.json +++ b/libs/red-cache/.eslintrc.json @@ -4,10 +4,7 @@ "overrides": [ { "files": ["*.ts"], - "extends": [ - "plugin:@nrwl/nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], + "extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], "parserOptions": { "project": ["libs/red-cache/tsconfig.*?.json"] }, diff --git a/libs/red-cache/jest.config.js b/libs/red-cache/jest.config.js index 2a387101b..197cb6356 100644 --- a/libs/red-cache/jest.config.js +++ b/libs/red-cache/jest.config.js @@ -5,10 +5,7 @@ module.exports = { 'ts-jest': { stringifyContentPathRegex: '\\.(html|svg)$', astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer' - ] + 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 f4a9b7524..1d7d4aa01 100644 --- a/libs/red-cache/src/lib/caches/cache-api.service.ts +++ b/libs/red-cache/src/lib/caches/cache-api.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { DYNAMIC_CACHES, APP_LEVEL_CACHE } from './cache-utils'; +import { APP_LEVEL_CACHE, DYNAMIC_CACHES } from './cache-utils'; import { HttpEvent, HttpHeaders, HttpRequest, HttpResponse } from '@angular/common/http'; import { from, Observable, throwError } from 'rxjs'; import { map, mergeMap } from 'rxjs/operators'; @@ -12,17 +12,17 @@ export class CacheApiService { this.checkCachesExpiration(); } + get cachesAvailable(): boolean { + return !!window.caches; + } + cacheRequest(request: HttpRequest, httpResponse: HttpResponse): Promise { if (httpResponse.status < 300 && httpResponse.status >= 200) { const url = this._buildUrl(request); 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)); } } } @@ -160,6 +160,15 @@ export class CacheApiService { return false; } + checkCachesExpiration() { + if (this.cachesAvailable) { + const now = new Date().getTime(); + for (const dynCache of DYNAMIC_CACHES) { + this._handleCacheExpiration(dynCache, now); + } + } + } + private _toHttpResponse(response: Response): Observable> { response = response.clone(); const contentType = response.headers.get('content-type'); @@ -224,15 +233,6 @@ export class CacheApiService { cache.put(url, new Response(body, cachedResponseFields)); } - checkCachesExpiration() { - if (this.cachesAvailable) { - const now = new Date().getTime(); - for (const dynCache of DYNAMIC_CACHES) { - this._handleCacheExpiration(dynCache, now); - } - } - } - private _handleCacheExpiration(dynCache, now) { caches.open(dynCache.name).then(cache => { cache.keys().then(keys => { @@ -263,10 +263,6 @@ export class CacheApiService { }); } - get cachesAvailable(): boolean { - return !!window.caches; - } - private _toHttpHeaders(headers: Headers): HttpHeaders { let httpHeaders = new HttpHeaders(); headers.forEach((value, key) => { 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 e6119d29d..fb3077403 100644 --- a/libs/red-cache/src/lib/caches/http-cache-interceptor.ts +++ b/libs/red-cache/src/lib/caches/http-cache-interceptor.ts @@ -1,10 +1,4 @@ -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'; diff --git a/libs/red-cache/src/test.ts b/libs/red-cache/src/test.ts index 882de64a8..8ff0d4a25 100644 --- a/libs/red-cache/src/test.ts +++ b/libs/red-cache/src/test.ts @@ -4,10 +4,7 @@ import 'core-js/es7/reflect'; import 'zone.js'; import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; +import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; declare const require: any; diff --git a/libs/red-ui-http/.eslintrc.json b/libs/red-ui-http/.eslintrc.json index 086670f3a..4b905e040 100644 --- a/libs/red-ui-http/.eslintrc.json +++ b/libs/red-ui-http/.eslintrc.json @@ -4,10 +4,7 @@ "overrides": [ { "files": ["*.ts"], - "extends": [ - "plugin:@nrwl/nx/angular", - "plugin:@angular-eslint/template/process-inline-templates" - ], + "extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], "parserOptions": { "project": ["libs/red-ui-http/tsconfig.*?.json"] }, diff --git a/libs/red-ui-http/jest.config.js b/libs/red-ui-http/jest.config.js index f2d44522e..cc5fd00cb 100644 --- a/libs/red-ui-http/jest.config.js +++ b/libs/red-ui-http/jest.config.js @@ -5,10 +5,7 @@ module.exports = { 'ts-jest': { stringifyContentPathRegex: '\\.(html|svg)$', astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer' - ] + 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.module.ts b/libs/red-ui-http/src/lib/api.module.ts index cb9572988..167564021 100644 --- a/libs/red-ui-http/src/lib/api.module.ts +++ b/libs/red-ui-http/src/lib/api.module.ts @@ -69,8 +69,7 @@ export class ApiModule { } if (!http) { throw new Error( - 'You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575' + 'You need to import the HttpClientModule in your AppModule! \n' + 'See also https://github.com/angular/angular/issues/20575' ); } } 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 ca9c7491c..187f4185d 100644 --- a/libs/red-ui-http/src/lib/api/auditController.service.ts +++ b/libs/red-ui-http/src/lib/api/auditController.service.ts @@ -48,54 +48,35 @@ 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?: 'body', reportProgress?: boolean): Observable>; - public getAuditCategories( - observe?: 'response', - reportProgress?: boolean - ): Observable>>; + public getAuditCategories(observe?: 'response', reportProgress?: boolean): Observable>>; - public getAuditCategories( - observe?: 'events', - reportProgress?: boolean - ): Observable>>; + public getAuditCategories(observe?: 'events', reportProgress?: boolean): Observable>>; - public getAuditCategories( - observe: any = 'body', - reportProgress: boolean = false - ): 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; + 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>( - '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 + }); } /** @@ -105,11 +86,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public searchAuditLog( body: AuditSearchRequest, @@ -117,21 +94,11 @@ export class AuditControllerService { reportProgress?: boolean ): Observable>; - public searchAuditLog( - body: AuditSearchRequest, - observe?: 'events', - 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: 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; @@ -139,24 +106,20 @@ export class AuditControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 7b129a6bf..27b384295 100644 --- a/libs/red-ui-http/src/lib/api/debugController.service.ts +++ b/libs/red-ui-http/src/lib/api/debugController.service.ts @@ -47,12 +47,7 @@ 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, @@ -61,23 +56,11 @@ export class DebugControllerService { 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() }); @@ -90,16 +73,13 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -143,37 +123,15 @@ 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() }); @@ -186,16 +144,13 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -240,37 +195,15 @@ 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() }); @@ -283,16 +216,13 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -369,9 +299,7 @@ export class DebugControllerService { 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() }); @@ -387,16 +315,13 @@ export class DebugControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/dictionaryController.service.ts b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts index 28fe72ac1..ce77d7944 100644 --- a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts +++ b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts @@ -100,9 +100,7 @@ export class DictionaryControllerService { } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling addEntry.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling addEntry.'); } if (type === null || type === undefined) { @@ -122,33 +120,27 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, params: queryParameters, @@ -168,33 +160,13 @@ export class DictionaryControllerService { * @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 addType( - body: TypeValue, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public addType(body: TypeValue, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable; - public addType( - body: TypeValue, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public addType(body: TypeValue, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable>; - public addType( - body: TypeValue, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public addType(body: TypeValue, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable>; - public addType( - body: TypeValue, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public addType(body: TypeValue, dossierId?: 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 addType.'); } @@ -209,24 +181,20 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -287,21 +255,15 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling deleteEntries.' - ); + throw new Error('Required parameter body was null or undefined when calling deleteEntries.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteEntries.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteEntries.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling deleteEntries.' - ); + throw new Error('Required parameter type was null or undefined when calling deleteEntries.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -314,33 +276,27 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dictionary/delete/${encodeURIComponent( - String(type) - )}/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/dictionary/delete/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, params: queryParameters, @@ -398,21 +354,15 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteEntry.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteEntry.'); } if (entry === null || entry === undefined) { - throw new Error( - 'Required parameter entry was null or undefined when calling deleteEntry.' - ); + throw new Error('Required parameter entry was null or undefined when calling deleteEntry.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling deleteEntry.' - ); + throw new Error('Required parameter type was null or undefined when calling deleteEntry.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -425,16 +375,13 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -495,15 +442,11 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteType.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteType.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling deleteType.' - ); + throw new Error('Required parameter type was null or undefined when calling deleteType.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -516,25 +459,20 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dictionary/type/${encodeURIComponent( - String(type) - )}/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -586,15 +524,11 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling deleteTypes.' - ); + throw new Error('Required parameter body was null or undefined when calling deleteTypes.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteTypes.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteTypes.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -607,33 +541,27 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dictionary/type/${encodeURIComponent( - String(dossierTemplateId) - )}/delete`, + `${this.basePath}/dictionary/type/${encodeURIComponent(String(dossierTemplateId))}/delete`, { body: body, params: queryParameters, @@ -686,15 +614,11 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling downloadDictionaryFile.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadDictionaryFile.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling downloadDictionaryFile.' - ); + throw new Error('Required parameter type was null or undefined when calling downloadDictionaryFile.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -707,25 +631,20 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/dictionary/download/${encodeURIComponent( - String(type) - )}/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/dictionary/download/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -744,12 +663,7 @@ export class DictionaryControllerService { * @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 getAllTypes( - dossierTemplateId: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getAllTypes(dossierTemplateId: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable; public getAllTypes( dossierTemplateId: string, @@ -772,9 +686,7 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getAllTypes.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getAllTypes.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -787,16 +699,13 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -821,33 +730,15 @@ export class DictionaryControllerService { * @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 getColors( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getColors(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - public getColors( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public getColors(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public getColors( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getColors(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public getColors( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getColors(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getColors.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getColors.'); } let headers = this.defaultHeaders; @@ -855,30 +746,23 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'get', - `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -922,15 +806,11 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getDictionaryForType.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDictionaryForType.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling getDictionaryForType.' - ); + throw new Error('Required parameter type was null or undefined when calling getDictionaryForType.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -943,25 +823,20 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -980,12 +855,7 @@ export class DictionaryControllerService { * @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 setColors( - body: Colors, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public setColors(body: Colors, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; public setColors( body: Colors, @@ -994,29 +864,15 @@ export class DictionaryControllerService { reportProgress?: boolean ): Observable>; - public setColors( - body: Colors, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public setColors(body: Colors, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public setColors( - body: Colors, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public setColors(body: Colors, dossierTemplateId: 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 setColors.' - ); + throw new Error('Required parameter body was null or undefined when calling setColors.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling setColors.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling setColors.'); } let headers = this.defaultHeaders; @@ -1024,39 +880,31 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/color/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -1105,21 +953,15 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling updateType.' - ); + throw new Error('Required parameter body was null or undefined when calling updateType.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling updateType.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling updateType.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling updateType.' - ); + throw new Error('Required parameter type was null or undefined when calling updateType.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -1132,33 +974,27 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dictionary/type/${encodeURIComponent( - String(type) - )}/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, params: queryParameters, @@ -1216,15 +1052,11 @@ export class DictionaryControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling uploadDictionaryFile.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadDictionaryFile.'); } if (type === null || type === undefined) { - throw new Error( - 'Required parameter type was null or undefined when calling uploadDictionaryFile.' - ); + throw new Error('Required parameter type was null or undefined when calling uploadDictionaryFile.'); } let headers = this.defaultHeaders; @@ -1232,16 +1064,13 @@ export class DictionaryControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -1272,9 +1101,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dictionary/upload/${encodeURIComponent( - String(type) - )}/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/dictionary/upload/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, { body: convertFormParamsToString ? formParams.toString() : formParams, withCredentials: this.configuration.withCredentials, diff --git a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts b/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts index f46bb07d3..541ff9518 100644 --- a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts +++ b/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts @@ -50,35 +50,23 @@ export class DigitalSignatureControllerService { */ public deleteDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable; - public deleteDigitalSignature( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public deleteDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable>; - public deleteDigitalSignature( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public deleteDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable>; - public deleteDigitalSignature( - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteDigitalSignature(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; + 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); } @@ -97,54 +85,35 @@ export class DigitalSignatureControllerService { * @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 getDigitalSignature( - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable; - public getDigitalSignature( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public getDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable>; - public getDigitalSignature( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable>; - public getDigitalSignature( - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getDigitalSignature(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; + 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( - 'get', - `${this.basePath}/digital-signature`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/digital-signature`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -172,15 +141,9 @@ export class DigitalSignatureControllerService { reportProgress?: boolean ): Observable>; - public saveDigitalSignature( - body: DigitalSignature, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public saveDigitalSignature(body: DigitalSignature, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling saveDigitalSignature.' - ); + throw new Error('Required parameter body was null or undefined when calling saveDigitalSignature.'); } let headers = this.defaultHeaders; @@ -188,39 +151,31 @@ export class DigitalSignatureControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/digital-signature`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/digital-signature`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -230,11 +185,7 @@ export class DigitalSignatureControllerService { * @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 updateDigitalSignature( - body: DigitalSignatureViewModelReq, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public updateDigitalSignature(body: DigitalSignatureViewModelReq, observe?: 'body', reportProgress?: boolean): Observable; public updateDigitalSignature( body: DigitalSignatureViewModelReq, @@ -254,9 +205,7 @@ export class DigitalSignatureControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling saveDigitalSignature1.' - ); + throw new Error('Required parameter body was null or undefined when calling saveDigitalSignature1.'); } let headers = this.defaultHeaders; @@ -264,24 +213,20 @@ export class DigitalSignatureControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/dossierController.service.ts b/libs/red-ui-http/src/lib/api/dossierController.service.ts index 4ed3a9f5c..8995f46de 100644 --- a/libs/red-ui-http/src/lib/api/dossierController.service.ts +++ b/libs/red-ui-http/src/lib/api/dossierController.service.ts @@ -24,9 +24,9 @@ import { Configuration } from '../configuration'; @Injectable() export class DossierControllerService { - protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); + protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -42,20 +42,6 @@ export class DossierControllerService { } } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } - /** * Creates or updates a dossier. * None @@ -63,30 +49,15 @@ export class DossierControllerService { * @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 createOrUpdateDossier( - body: DossierRequest, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public createOrUpdateDossier( - body: DossierRequest, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public createOrUpdateDossier( - body: DossierRequest, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public createOrUpdateDossier( - body: DossierRequest, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public createOrUpdateDossier(body: DossierRequest, observe?: 'body', reportProgress?: boolean): Observable; + + public createOrUpdateDossier(body: DossierRequest, observe?: 'response', reportProgress?: boolean): Observable>; + + public createOrUpdateDossier(body: DossierRequest, observe?: 'events', reportProgress?: boolean): Observable>; + + public createOrUpdateDossier(body: DossierRequest, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling createOrUpdateDossier.' - ); + throw new Error('Required parameter body was null or undefined when calling createOrUpdateDossier.'); } let headers = this.defaultHeaders; @@ -94,24 +65,20 @@ export class DossierControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -132,30 +99,15 @@ export class DossierControllerService { * @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 deleteDossier( - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public deleteDossier( - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public deleteDossier( - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public deleteDossier( - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; + + public deleteDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; + + public deleteDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public deleteDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling deleteDossier.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling deleteDossier.'); } let headers = this.defaultHeaders; @@ -163,30 +115,23 @@ export class DossierControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dossier/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('delete', `${this.basePath}/dossier/${encodeURIComponent(String(dossierId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -195,37 +140,25 @@ export class DossierControllerService { * @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 getDeletedDossiers( - observe?: 'body', - reportProgress?: boolean - ): Observable>; - public getDeletedDossiers( - observe?: 'response', - reportProgress?: boolean - ): Observable>>; - public getDeletedDossiers( - observe?: 'events', - reportProgress?: boolean - ): Observable>>; - public getDeletedDossiers( - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getDeletedDossiers(observe?: 'body', reportProgress?: boolean): Observable>; + + public getDeletedDossiers(observe?: 'response', reportProgress?: boolean): Observable>>; + + public getDeletedDossiers(observe?: 'events', reportProgress?: boolean): Observable>>; + + public getDeletedDossiers(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; + 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); } @@ -245,30 +178,15 @@ export class DossierControllerService { * @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 getDossier( - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public getDossier( - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public getDossier( - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public getDossier( - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; + + public getDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; + + public getDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public getDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getDossier.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getDossier.'); } let headers = this.defaultHeaders; @@ -276,30 +194,23 @@ export class DossierControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'get', - `${this.basePath}/dossier/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/dossier/${encodeURIComponent(String(dossierId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -309,30 +220,24 @@ export class DossierControllerService { * @param reportProgress flag to report request and response progress. */ public getDossiers(observe?: 'body', reportProgress?: boolean): Observable>; - public getDossiers( - observe?: 'response', - reportProgress?: boolean - ): Observable>>; - public getDossiers( - observe?: 'events', - reportProgress?: boolean - ): Observable>>; + + public getDossiers(observe?: 'response', reportProgress?: boolean): Observable>>; + + public getDossiers(observe?: 'events', reportProgress?: boolean): Observable>>; + public getDossiers(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; + 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); } @@ -352,30 +257,15 @@ export class DossierControllerService { * @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 hardDeleteDossiers( - body: Array, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public hardDeleteDossiers( - body: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public hardDeleteDossiers( - body: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public hardDeleteDossiers( - body: Array, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public hardDeleteDossiers(body: Array, observe?: 'body', reportProgress?: boolean): Observable; + + public hardDeleteDossiers(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; + + public hardDeleteDossiers(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; + + public hardDeleteDossiers(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling hardDeleteDossiers.' - ); + throw new Error('Required parameter body was null or undefined when calling hardDeleteDossiers.'); } let headers = this.defaultHeaders; @@ -383,9 +273,7 @@ export class DossierControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; + typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } @@ -396,32 +284,26 @@ export class DossierControllerService { // 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( - 'delete', - `${this.basePath}/deleted-dossiers/hard-delete`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('delete', `${this.basePath}/deleted-dossiers/hard-delete`, { + body: body, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -431,30 +313,15 @@ export class DossierControllerService { * @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 restoreDossiers( - body: Array, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public restoreDossiers( - body: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public restoreDossiers( - body: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public restoreDossiers( - body: Array, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public restoreDossiers(body: Array, observe?: 'body', reportProgress?: boolean): Observable; + + public restoreDossiers(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; + + public restoreDossiers(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; + + public restoreDossiers(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling restoreDossiers.' - ); + throw new Error('Required parameter body was null or undefined when calling restoreDossiers.'); } let headers = this.defaultHeaders; @@ -462,9 +329,7 @@ export class DossierControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; + typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } @@ -475,16 +340,14 @@ export class DossierControllerService { // 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); } @@ -498,4 +361,18 @@ export class DossierControllerService { reportProgress: reportProgress }); } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } } diff --git a/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts b/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts index 02d8c84c9..6276e3e9f 100644 --- a/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts +++ b/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts @@ -71,9 +71,7 @@ export class DossierTemplateControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling createOrUpdateDossierTemplate.' - ); + throw new Error('Required parameter body was null or undefined when calling createOrUpdateDossierTemplate.'); } let headers = this.defaultHeaders; @@ -81,39 +79,31 @@ export class DossierTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/dossier-template`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/dossier-template`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -123,33 +113,15 @@ export class DossierTemplateControllerService { * @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 deleteDossierTemplate( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public deleteDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - public deleteDossierTemplate( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public deleteDossierTemplate(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public deleteDossierTemplate( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public deleteDossierTemplate(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public deleteDossierTemplate( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteDossierTemplate.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierTemplate.'); } let headers = this.defaultHeaders; @@ -157,16 +129,13 @@ export class DossierTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -190,30 +159,12 @@ export class DossierTemplateControllerService { * @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 deleteDossierTemplates( - body: Array, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public deleteDossierTemplates( - body: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public deleteDossierTemplates( - body: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public deleteDossierTemplates( - body: Array, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteDossierTemplates(body: Array, observe?: 'body', reportProgress?: boolean): Observable; + public deleteDossierTemplates(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteDossierTemplates(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteDossierTemplates(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling deleteDossierTemplates.' - ); + throw new Error('Required parameter body was null or undefined when calling deleteDossierTemplates.'); } let headers = this.defaultHeaders; @@ -221,24 +172,20 @@ export class DossierTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -258,54 +205,35 @@ export class DossierTemplateControllerService { * @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 getAllDossierTemplates( - observe?: 'body', - reportProgress?: boolean - ): Observable>; + public getAllDossierTemplates(observe?: 'body', reportProgress?: boolean): Observable>; - public getAllDossierTemplates( - observe?: 'response', - reportProgress?: boolean - ): Observable>>; + public getAllDossierTemplates(observe?: 'response', reportProgress?: boolean): Observable>>; - public getAllDossierTemplates( - observe?: 'events', - reportProgress?: boolean - ): Observable>>; + public getAllDossierTemplates(observe?: 'events', reportProgress?: boolean): Observable>>; - public getAllDossierTemplates( - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getAllDossierTemplates(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; + 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>( - 'get', - `${this.basePath}/dossier-template`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request>('get', `${this.basePath}/dossier-template`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -315,11 +243,7 @@ export class DossierTemplateControllerService { * @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 getDossierTemplate( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; public getDossierTemplate( dossierTemplateId: string, @@ -333,15 +257,9 @@ export class DossierTemplateControllerService { reportProgress?: boolean ): Observable>; - public getDossierTemplate( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getDossierTemplate.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierTemplate.'); } let headers = this.defaultHeaders; @@ -349,16 +267,13 @@ export class DossierTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/downloadController.service.ts b/libs/red-ui-http/src/lib/api/downloadController.service.ts index 14ec27043..0905bfff4 100644 --- a/libs/red-ui-http/src/lib/api/downloadController.service.ts +++ b/libs/red-ui-http/src/lib/api/downloadController.service.ts @@ -52,37 +52,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public downloadFile( - storageId: string, - inline?: boolean, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public downloadFile( - storageId: string, - inline?: boolean, - observe: any = 'body', - reportProgress: boolean = false - ): 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() }); @@ -98,16 +76,13 @@ export class DownloadControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -127,54 +102,35 @@ 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?: 'body', reportProgress?: boolean): Observable; - public getDownloadStatus( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public getDownloadStatus(observe?: 'response', reportProgress?: boolean): Observable>; - public getDownloadStatus( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getDownloadStatus(observe?: 'events', reportProgress?: boolean): Observable>; - public getDownloadStatus( - observe: any = 'body', - reportProgress: boolean = false - ): 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; + 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( - '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 + }); } /** @@ -184,11 +140,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public prepareDownload( body: PrepareDownloadRequest, @@ -202,15 +154,9 @@ export class DownloadControllerService { reportProgress?: boolean ): Observable>; - public prepareDownload( - body: PrepareDownloadRequest, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -218,39 +164,31 @@ export class DownloadControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 + }); } /** @@ -260,33 +198,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public deleteDownload( - body: RemoveDownloadRequest, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public deleteDownload( - body: RemoveDownloadRequest, - observe: any = 'body', - reportProgress: boolean = false - ): 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 prepareDownload1.' - ); + throw new Error('Required parameter body was null or undefined when calling prepareDownload1.'); } let headers = this.defaultHeaders; @@ -294,24 +214,20 @@ export class DownloadControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/fileAttributesController.service.ts b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts index f7c2e2627..689b985f9 100644 --- a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts @@ -78,15 +78,11 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteFileAttribute.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteFileAttribute.'); } if (fileAttributeId === null || fileAttributeId === undefined) { - throw new Error( - 'Required parameter fileAttributeId was null or undefined when calling deleteFileAttribute.' - ); + throw new Error('Required parameter fileAttributeId was null or undefined when calling deleteFileAttribute.'); } let headers = this.defaultHeaders; @@ -94,25 +90,22 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/fileAttributes/config/fileAttribute/${encodeURIComponent( - String(dossierTemplateId) - )}/${encodeURIComponent(String(fileAttributeId))}`, + `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent( + String(fileAttributeId) + )}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -158,15 +151,11 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling deleteFileAttributes.' - ); + throw new Error('Required parameter body was null or undefined when calling deleteFileAttributes.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteFileAttributes.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteFileAttributes.'); } let headers = this.defaultHeaders; @@ -174,33 +163,27 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/fileAttributes/config/fileAttribute/${encodeURIComponent( - String(dossierTemplateId) - )}/delete`, + `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}/delete`, { body: body, withCredentials: this.configuration.withCredentials, @@ -242,9 +225,7 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getFileAttributesConfiguration.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getFileAttributesConfiguration.'); } let headers = this.defaultHeaders; @@ -252,25 +233,20 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/fileAttributes/config/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/fileAttributes/config/${encodeURIComponent(String(dossierTemplateId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -321,21 +297,15 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setFileAttributes.' - ); + throw new Error('Required parameter body was null or undefined when calling setFileAttributes.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setFileAttributes.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setFileAttributes.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling setFileAttributes.' - ); + throw new Error('Required parameter fileId was null or undefined when calling setFileAttributes.'); } let headers = this.defaultHeaders; @@ -343,33 +313,27 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/fileAttributes/set/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/fileAttributes/set/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -416,15 +380,11 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setFileAttributesConfig.' - ); + throw new Error('Required parameter body was null or undefined when calling setFileAttributesConfig.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfig.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfig.'); } let headers = this.defaultHeaders; @@ -432,33 +392,27 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'put', - `${this.basePath}/fileAttributes/config/baseConfig/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/fileAttributes/config/baseConfig/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -505,15 +459,11 @@ export class FileAttributesControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setFileAttributesConfiguration.' - ); + throw new Error('Required parameter body was null or undefined when calling setFileAttributesConfiguration.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfiguration.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfiguration.'); } let headers = this.defaultHeaders; @@ -521,33 +471,27 @@ export class FileAttributesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/fileAttributes/config/fileAttribute/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, withCredentials: this.configuration.withCredentials, diff --git a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts index e65b0b80c..19ba3aa4c 100644 --- a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts @@ -21,9 +21,9 @@ import { Configuration } from '../configuration'; @Injectable() export class FileManagementControllerService { - protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); + protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -39,20 +39,6 @@ export class FileManagementControllerService { } } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } - /** * Deletes a file for a given dossierId and FileId * None @@ -61,40 +47,19 @@ export class FileManagementControllerService { * @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 deleteFile( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - public deleteFile( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - public deleteFile( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public deleteFile( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteFile(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + + public deleteFile(dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + + public deleteFile(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public deleteFile(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling deleteFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling deleteFile.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling deleteFile.' - ); + throw new Error('Required parameter fileId was null or undefined when calling deleteFile.'); } let headers = this.defaultHeaders; @@ -102,25 +67,20 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/delete/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId) - )}`, + `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -138,40 +98,24 @@ export class FileManagementControllerService { * @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 deleteFiles( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public deleteFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteFiles( body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public deleteFiles( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public deleteFiles( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + + public deleteFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public deleteFiles(body: Array, dossierId: 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 deleteFiles.' - ); + throw new Error('Required parameter body was null or undefined when calling deleteFiles.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling deleteFiles.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling deleteFiles.'); } let headers = this.defaultHeaders; @@ -179,39 +123,31 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/delete/${encodeURIComponent(String(dossierId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -230,6 +166,7 @@ export class FileManagementControllerService { observe?: 'body', reportProgress?: boolean ): Observable; + public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -237,6 +174,7 @@ export class FileManagementControllerService { observe?: 'response', reportProgress?: boolean ): Observable>; + public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -244,6 +182,7 @@ export class FileManagementControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; + public downloadAnnotatedFile( dossierId: string, fileId: string, @@ -252,15 +191,11 @@ export class FileManagementControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadAnnotatedFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling downloadAnnotatedFile.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadAnnotatedFile.' - ); + throw new Error('Required parameter fileId was null or undefined when calling downloadAnnotatedFile.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -273,25 +208,20 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/download/annotated/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/download/annotated/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -347,15 +277,11 @@ export class FileManagementControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadOriginalFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling downloadOriginalFile.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadOriginalFile.' - ); + throw new Error('Required parameter fileId was null or undefined when calling downloadOriginalFile.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -371,25 +297,20 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/download/original/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/download/original/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { responseType: 'blob', params: queryParameters, @@ -409,40 +330,24 @@ export class FileManagementControllerService { * @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 hardDeleteFile( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public hardDeleteFile(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; + public hardDeleteFile( body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public hardDeleteFile( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public hardDeleteFile( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + + public hardDeleteFile(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public hardDeleteFile(body: Array, dossierId: 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 hardDeleteFile.' - ); + throw new Error('Required parameter body was null or undefined when calling hardDeleteFile.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling hardDeleteFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling hardDeleteFile.'); } let headers = this.defaultHeaders; @@ -450,39 +355,31 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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[] = ['*/*']; - 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( - 'delete', - `${this.basePath}/delete/hard-delete/${encodeURIComponent(String(dossierId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('delete', `${this.basePath}/delete/hard-delete/${encodeURIComponent(String(dossierId))}`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -493,40 +390,24 @@ export class FileManagementControllerService { * @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 restoreFiles( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public restoreFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; + public restoreFiles( body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public restoreFiles( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - public restoreFiles( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + + public restoreFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; + + public restoreFiles(body: Array, dossierId: 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 restoreFiles.' - ); + throw new Error('Required parameter body was null or undefined when calling restoreFiles.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling restoreFiles.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling restoreFiles.'); } let headers = this.defaultHeaders; @@ -534,38 +415,44 @@ export class FileManagementControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/delete/restore/${encodeURIComponent(String(dossierId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress + return this.httpClient.request('post', `${this.basePath}/delete/restore/${encodeURIComponent(String(dossierId))}`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; } - ); + } + return false; } } diff --git a/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts b/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts index 1d5722b0b..bc1256dee 100644 --- a/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts +++ b/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts @@ -46,54 +46,35 @@ export class GeneralSettingsControllerService { * @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 getGeneralConfigurations( - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getGeneralConfigurations(observe?: 'body', reportProgress?: boolean): Observable; - public getGeneralConfigurations( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public getGeneralConfigurations(observe?: 'response', reportProgress?: boolean): Observable>; - public getGeneralConfigurations( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getGeneralConfigurations(observe?: 'events', reportProgress?: boolean): Observable>; - public getGeneralConfigurations( - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getGeneralConfigurations(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; + 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( - 'get', - `${this.basePath}/configuration/general`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/configuration/general`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -103,11 +84,7 @@ export class GeneralSettingsControllerService { * @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 updateGeneralConfigurations( - body: GeneralConfigurationModel, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public updateGeneralConfigurations(body: GeneralConfigurationModel, observe?: 'body', reportProgress?: boolean): Observable; public updateGeneralConfigurations( body: GeneralConfigurationModel, @@ -127,9 +104,7 @@ export class GeneralSettingsControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling updateGeneralConfigurations.' - ); + throw new Error('Required parameter body was null or undefined when calling updateGeneralConfigurations.'); } let headers = this.defaultHeaders; @@ -137,24 +112,20 @@ export class GeneralSettingsControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/infoController.service.ts b/libs/red-ui-http/src/lib/api/infoController.service.ts index a16aeabac..f570b22fa 100644 --- a/libs/red-ui-http/src/lib/api/infoController.service.ts +++ b/libs/red-ui-http/src/lib/api/infoController.service.ts @@ -48,15 +48,9 @@ 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; @@ -64,16 +58,13 @@ export class InfoControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/legalBasisMappingController.service.ts b/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts index 894586ed8..d0398013c 100644 --- a/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts +++ b/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts @@ -65,15 +65,9 @@ export class LegalBasisMappingControllerService { reportProgress?: boolean ): Observable>>; - public getLegalBasisMapping( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getLegalBasisMapping(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getLegalBasisMapping.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getLegalBasisMapping.'); } let headers = this.defaultHeaders; @@ -81,16 +75,13 @@ export class LegalBasisMappingControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -143,15 +134,11 @@ export class LegalBasisMappingControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setLegalBasisMapping.' - ); + throw new Error('Required parameter body was null or undefined when calling setLegalBasisMapping.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling setLegalBasisMapping.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling setLegalBasisMapping.'); } let headers = this.defaultHeaders; @@ -159,38 +146,30 @@ export class LegalBasisMappingControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/legalBasis/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/legalBasis/${encodeURIComponent(String(dossierTemplateId))}`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } } 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 eadc5b1d5..1e0fa4ea6 100644 --- a/libs/red-ui-http/src/lib/api/licenseReportController.service.ts +++ b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts @@ -83,9 +83,7 @@ export class LicenseReportControllerService { 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() }); @@ -101,24 +99,20 @@ export class LicenseReportControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/manualRedactionController.service.ts b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts index 04368a8ad..9bf849ccc 100644 --- a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts +++ b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts @@ -31,9 +31,9 @@ import { Configuration } from '../configuration'; @Injectable() export class ManualRedactionControllerService { - protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); + protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -92,27 +92,19 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling addComment.' - ); + throw new Error('Required parameter body was null or undefined when calling addComment.'); } if (annotationId === null || annotationId === undefined) { - throw new Error( - 'Required parameter annotationId was null or undefined when calling addComment.' - ); + throw new Error('Required parameter annotationId was null or undefined when calling addComment.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling addComment.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling addComment.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling addComment.' - ); + throw new Error('Required parameter fileId was null or undefined when calling addComment.'); } let headers = this.defaultHeaders; @@ -120,33 +112,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/comment/add/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(annotationId))}`, + `${this.basePath}/manualRedaction/comment/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(annotationId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -195,21 +183,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling addRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling addRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling addRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling addRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling addRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling addRedaction.'); } let headers = this.defaultHeaders; @@ -217,33 +199,27 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/redaction/add/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/redaction/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -297,27 +273,19 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling approveRequest.' - ); + throw new Error('Required parameter body was null or undefined when calling approveRequest.'); } if (annotationId === null || annotationId === undefined) { - throw new Error( - 'Required parameter annotationId was null or undefined when calling approveRequest.' - ); + throw new Error('Required parameter annotationId was null or undefined when calling approveRequest.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling approveRequest.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling approveRequest.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling approveRequest.' - ); + throw new Error('Required parameter fileId was null or undefined when calling approveRequest.'); } let headers = this.defaultHeaders; @@ -325,33 +293,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/approve/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(annotationId))}`, + `${this.basePath}/manualRedaction/approve/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(annotationId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -400,21 +364,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (annotationId === null || annotationId === undefined) { - throw new Error( - 'Required parameter annotationId was null or undefined when calling declineRequest.' - ); + throw new Error('Required parameter annotationId was null or undefined when calling declineRequest.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling declineRequest.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling declineRequest.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling declineRequest.' - ); + throw new Error('Required parameter fileId was null or undefined when calling declineRequest.'); } let headers = this.defaultHeaders; @@ -422,25 +380,22 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/manualRedaction/decline/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(annotationId))}`, + `${this.basePath}/manualRedaction/decline/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(annotationId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -488,21 +443,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling forceRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling forceRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling forceRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling forceRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling forceRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling forceRedaction.'); } let headers = this.defaultHeaders; @@ -510,33 +459,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/redaction/force/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/redaction/force/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -555,12 +500,7 @@ export class ManualRedactionControllerService { * @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 getManualRedaction( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getManualRedaction(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getManualRedaction( dossierId: string, fileId: string, @@ -573,22 +513,13 @@ export class ManualRedactionControllerService { observe?: 'events', reportProgress?: boolean ): Observable>; - public getManualRedaction( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getManualRedaction(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getManualRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getManualRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getManualRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getManualRedaction.'); } let headers = this.defaultHeaders; @@ -596,25 +527,20 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/manualRedaction/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -662,21 +588,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling legalBasisChange.' - ); + throw new Error('Required parameter body was null or undefined when calling legalBasisChange.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling legalBasisChange.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling legalBasisChange.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling legalBasisChange.' - ); + throw new Error('Required parameter fileId was null or undefined when calling legalBasisChange.'); } let headers = this.defaultHeaders; @@ -684,33 +604,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/redaction/legalBasisChange/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/redaction/legalBasisChange/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -759,21 +675,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling recategorizeImage.' - ); + throw new Error('Required parameter body was null or undefined when calling recategorizeImage.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling recategorizeImage.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling recategorizeImage.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling recategorizeImage.' - ); + throw new Error('Required parameter fileId was null or undefined when calling recategorizeImage.'); } let headers = this.defaultHeaders; @@ -781,33 +691,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/redaction/recategorize/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/redaction/recategorize/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -856,21 +762,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling removeRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling removeRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling removeRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling removeRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling removeRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling removeRedaction.'); } let headers = this.defaultHeaders; @@ -878,33 +778,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/redaction/remove/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/redaction/remove/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -953,21 +849,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling requestAddRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling requestAddRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling requestAddRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling requestAddRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling requestAddRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling requestAddRedaction.'); } let headers = this.defaultHeaders; @@ -975,33 +865,27 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/request/add/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/request/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1050,21 +934,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling requestForceRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling requestForceRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling requestForceRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling requestForceRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling requestForceRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling requestForceRedaction.'); } let headers = this.defaultHeaders; @@ -1072,33 +950,27 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/request/force/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/request/force/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1147,21 +1019,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling requestImageRecategorization.' - ); + throw new Error('Required parameter body was null or undefined when calling requestImageRecategorization.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling requestImageRecategorization.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling requestImageRecategorization.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling requestImageRecategorization.' - ); + throw new Error('Required parameter fileId was null or undefined when calling requestImageRecategorization.'); } let headers = this.defaultHeaders; @@ -1169,33 +1035,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/request/recategorize/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/request/recategorize/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1244,21 +1106,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling requestLegalBasisChange.' - ); + throw new Error('Required parameter body was null or undefined when calling requestLegalBasisChange.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling requestLegalBasisChange.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling requestLegalBasisChange.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling requestLegalBasisChange.' - ); + throw new Error('Required parameter fileId was null or undefined when calling requestLegalBasisChange.'); } let headers = this.defaultHeaders; @@ -1266,33 +1122,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/request/legalBasis/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/request/legalBasis/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1341,21 +1193,15 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling requestRemoveRedaction.' - ); + throw new Error('Required parameter body was null or undefined when calling requestRemoveRedaction.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling requestRemoveRedaction.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling requestRemoveRedaction.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling requestRemoveRedaction.' - ); + throw new Error('Required parameter fileId was null or undefined when calling requestRemoveRedaction.'); } let headers = this.defaultHeaders; @@ -1363,33 +1209,29 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/request/remove/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/manualRedaction/request/remove/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1409,13 +1251,7 @@ export class ManualRedactionControllerService { * @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 undo( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public undo(annotationId: string, dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public undo( annotationId: string, dossierId: string, @@ -1438,15 +1274,11 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (annotationId === null || annotationId === undefined) { - throw new Error( - 'Required parameter annotationId was null or undefined when calling undo.' - ); + throw new Error('Required parameter annotationId was null or undefined when calling undo.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling undo.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling undo.'); } if (fileId === null || fileId === undefined) { @@ -1458,25 +1290,22 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/manualRedaction/undo/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(annotationId))}`, + `${this.basePath}/manualRedaction/undo/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(annotationId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -1529,27 +1358,19 @@ export class ManualRedactionControllerService { reportProgress: boolean = false ): Observable { if (annotationId === null || annotationId === undefined) { - throw new Error( - 'Required parameter annotationId was null or undefined when calling undoComment.' - ); + throw new Error('Required parameter annotationId was null or undefined when calling undoComment.'); } if (commentId === null || commentId === undefined) { - throw new Error( - 'Required parameter commentId was null or undefined when calling undoComment.' - ); + throw new Error('Required parameter commentId was null or undefined when calling undoComment.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling undoComment.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling undoComment.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling undoComment.' - ); + throw new Error('Required parameter fileId was null or undefined when calling undoComment.'); } let headers = this.defaultHeaders; @@ -1557,16 +1378,13 @@ export class ManualRedactionControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -1574,11 +1392,9 @@ export class ManualRedactionControllerService { // to determine the Content-Type header return this.httpClient.request( 'delete', - `${this.basePath}/manualRedaction/comment/undo/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent( - String(annotationId) - )}/${encodeURIComponent(String(commentId))}`, + `${this.basePath}/manualRedaction/comment/undo/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(annotationId))}/${encodeURIComponent(String(commentId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/libs/red-ui-http/src/lib/api/reanalysisController.service.ts b/libs/red-ui-http/src/lib/api/reanalysisController.service.ts index b7a8a3861..540f5dcad 100644 --- a/libs/red-ui-http/src/lib/api/reanalysisController.service.ts +++ b/libs/red-ui-http/src/lib/api/reanalysisController.service.ts @@ -82,21 +82,15 @@ export class ReanalysisControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling excludePages.' - ); + throw new Error('Required parameter body was null or undefined when calling excludePages.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling excludePages.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling excludePages.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling excludePages.' - ); + throw new Error('Required parameter fileId was null or undefined when calling excludePages.'); } let headers = this.defaultHeaders; @@ -104,33 +98,27 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/exclude-pages/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/exclude-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -182,21 +170,15 @@ export class ReanalysisControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling includePages.' - ); + throw new Error('Required parameter body was null or undefined when calling includePages.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling includePages.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling includePages.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling includePages.' - ); + throw new Error('Required parameter fileId was null or undefined when calling includePages.'); } let headers = this.defaultHeaders; @@ -204,33 +186,27 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/include-pages/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/include-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -248,33 +224,15 @@ export class ReanalysisControllerService { * @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 ocrDossier( - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public ocrDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - public ocrDossier( - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public ocrDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public ocrDossier( - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public ocrDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public ocrDossier( - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public ocrDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling ocrDossier.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling ocrDossier.'); } let headers = this.defaultHeaders; @@ -282,30 +240,23 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'post', - `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -316,43 +267,19 @@ export class ReanalysisControllerService { * @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 ocrFile( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public ocrFile(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - public ocrFile( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public ocrFile(dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public ocrFile( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public ocrFile(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public ocrFile( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public ocrFile(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling ocrFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling ocrFile.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling ocrFile.' - ); + throw new Error('Required parameter fileId was null or undefined when calling ocrFile.'); } let headers = this.defaultHeaders; @@ -360,25 +287,20 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/ocr/reanalyze/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -396,41 +318,19 @@ export class ReanalysisControllerService { * @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 ocrFiles( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public ocrFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - public ocrFiles( - body: Array, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public ocrFiles(body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public ocrFiles( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public ocrFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public ocrFiles( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public ocrFiles(body: Array, dossierId: 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 ocrFiles.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling ocrFiles.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling ocrFiles.'); } let headers = this.defaultHeaders; @@ -438,39 +338,31 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -481,12 +373,7 @@ export class ReanalysisControllerService { * @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 reanalyzeDossier( - dossierId: string, - force?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; public reanalyzeDossier( dossierId: string, @@ -495,23 +382,11 @@ export class ReanalysisControllerService { reportProgress?: boolean ): Observable>; - public reanalyzeDossier( - dossierId: string, - force?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; - public reanalyzeDossier( - dossierId: string, - force?: boolean, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public reanalyzeDossier(dossierId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling reanalyzeDossier.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeDossier.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -524,31 +399,24 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'post', - `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}`, { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -560,13 +428,7 @@ export class ReanalysisControllerService { * @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 reanalyzeFile( - dossierId: string, - fileId: string, - force?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public reanalyzeFile(dossierId: string, fileId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; public reanalyzeFile( dossierId: string, @@ -592,15 +454,11 @@ export class ReanalysisControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling reanalyzeFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFile.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling reanalyzeFile.' - ); + throw new Error('Required parameter fileId was null or undefined when calling reanalyzeFile.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -613,25 +471,20 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/reanalyze/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -683,15 +536,11 @@ export class ReanalysisControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling reanalyzeFilesForDossier.' - ); + throw new Error('Required parameter body was null or undefined when calling reanalyzeFilesForDossier.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling reanalyzeFilesForDossier.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFilesForDossier.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -704,40 +553,32 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { + body: body, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -781,15 +622,11 @@ export class ReanalysisControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling toggleAnalysis.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling toggleAnalysis.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling toggleAnalysis.' - ); + throw new Error('Required parameter fileId was null or undefined when calling toggleAnalysis.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -802,25 +639,20 @@ export class ReanalysisControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/toggle-analysis/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/toggle-analysis/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, diff --git a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts index 501789180..a5bccf3ad 100644 --- a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts +++ b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts @@ -78,15 +78,11 @@ export class RedactionLogControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLog.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLog.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLog.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getRedactionLog.'); } let headers = this.defaultHeaders; @@ -94,25 +90,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/redactionChnageLog/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/redactionChnageLog/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -130,12 +121,7 @@ export class RedactionLogControllerService { * @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 getRedactionLog( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getRedactionLog(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getRedactionLog( dossierId: string, @@ -151,22 +137,13 @@ export class RedactionLogControllerService { reportProgress?: boolean ): Observable>; - public getRedactionLog( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getRedactionLog(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLog1.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLog1.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLog1.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getRedactionLog1.'); } let headers = this.defaultHeaders; @@ -174,25 +151,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/redactionLog/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/redactionLog/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -201,6 +173,7 @@ export class RedactionLogControllerService { } ); } + /** * Gets the redaction log preview * None @@ -209,12 +182,7 @@ export class RedactionLogControllerService { * @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 getRedactionLogPreview( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getRedactionLogPreview(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getRedactionLogPreview( dossierId: string, fileId: string, @@ -234,15 +202,11 @@ export class RedactionLogControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getRedactionLogPreview.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLogPreview.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getRedactionLogPreview.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getRedactionLogPreview.'); } let headers = this.defaultHeaders; @@ -250,25 +214,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/sectionGrid/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/preview`, + `${this.basePath}/sectionGrid/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}/preview`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -286,12 +245,7 @@ export class RedactionLogControllerService { * @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 getSectionGrid( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getSectionGrid(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getSectionGrid( dossierId: string, @@ -307,22 +261,13 @@ export class RedactionLogControllerService { reportProgress?: boolean ): Observable>; - public getSectionGrid( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getSectionGrid(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getSectionGrid.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getSectionGrid.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getSectionGrid.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getSectionGrid.'); } let headers = this.defaultHeaders; @@ -330,25 +275,20 @@ export class RedactionLogControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/sectionGrid/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/sectionGrid/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts b/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts index 2dbfea216..ad39fcf90 100644 --- a/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts +++ b/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts @@ -49,12 +49,7 @@ export class ReportTemplateControllerService { * @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 deleteTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public deleteTemplate(dossierTemplateId: string, templateId: string, observe?: 'body', reportProgress?: boolean): Observable; public deleteTemplate( dossierTemplateId: string, @@ -77,15 +72,11 @@ export class ReportTemplateControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteTemplate.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteTemplate.'); } if (templateId === null || templateId === undefined) { - throw new Error( - 'Required parameter templateId was null or undefined when calling deleteTemplate.' - ); + throw new Error('Required parameter templateId was null or undefined when calling deleteTemplate.'); } let headers = this.defaultHeaders; @@ -93,25 +84,20 @@ export class ReportTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/templateUpload/${encodeURIComponent( - String(dossierTemplateId) - )}/${encodeURIComponent(String(templateId))}`, + `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(templateId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -157,15 +143,11 @@ export class ReportTemplateControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling downloadReportTemplate.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadReportTemplate.'); } if (templateId === null || templateId === undefined) { - throw new Error( - 'Required parameter templateId was null or undefined when calling downloadReportTemplate.' - ); + throw new Error('Required parameter templateId was null or undefined when calling downloadReportTemplate.'); } let headers = this.defaultHeaders; @@ -173,25 +155,20 @@ export class ReportTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/templateUpload/${encodeURIComponent( - String(dossierTemplateId) - )}/${encodeURIComponent(String(templateId))}`, + `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(templateId))}`, { withCredentials: this.configuration.withCredentials, responseType: 'blob', @@ -227,15 +204,9 @@ export class ReportTemplateControllerService { reportProgress?: boolean ): Observable>>; - public getAvailableReportTemplates( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getAvailableReportTemplates(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getAvailableReportTemplates.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getAvailableReportTemplates.'); } let headers = this.defaultHeaders; @@ -243,16 +214,13 @@ export class ReportTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -305,9 +273,7 @@ export class ReportTemplateControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling uploadTemplate.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadTemplate.'); } let headers = this.defaultHeaders; @@ -315,16 +281,13 @@ export class ReportTemplateControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/rulesController.service.ts b/libs/red-ui-http/src/lib/api/rulesController.service.ts index 6a1eea3d3..bfce50459 100644 --- a/libs/red-ui-http/src/lib/api/rulesController.service.ts +++ b/libs/red-ui-http/src/lib/api/rulesController.service.ts @@ -48,33 +48,15 @@ export class RulesControllerService { * @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 downloadRules( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public downloadRules(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - public downloadRules( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public downloadRules(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public downloadRules( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public downloadRules(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public downloadRules( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public downloadRules(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling downloadRules.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadRules.'); } let headers = this.defaultHeaders; @@ -82,30 +64,23 @@ export class RulesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'get', - `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -115,33 +90,15 @@ export class RulesControllerService { * @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 downloadRulesFile( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public downloadRulesFile(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - public downloadRulesFile( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public downloadRulesFile(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public downloadRulesFile( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public downloadRulesFile(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public downloadRulesFile( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public downloadRulesFile(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling downloadRulesFile.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadRulesFile.'); } let headers = this.defaultHeaders; @@ -149,30 +106,23 @@ export class RulesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - 'get', - `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/download`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('get', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/download`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -184,27 +134,13 @@ export class RulesControllerService { */ public uploadRules(body: Rules, observe?: 'body', reportProgress?: boolean): Observable; - public uploadRules( - body: Rules, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public uploadRules(body: Rules, observe?: 'response', reportProgress?: boolean): Observable>; - public uploadRules( - body: Rules, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public uploadRules(body: Rules, observe?: 'events', reportProgress?: boolean): Observable>; - public uploadRules( - body: Rules, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public uploadRules(body: Rules, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling uploadRules.' - ); + throw new Error('Required parameter body was null or undefined when calling uploadRules.'); } let headers = this.defaultHeaders; @@ -212,24 +148,20 @@ export class RulesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -251,12 +183,7 @@ export class RulesControllerService { * @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 uploadRulesFileForm( - dossierTemplateId: string, - file?: Blob, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public uploadRulesFileForm(dossierTemplateId: string, file?: Blob, observe?: 'body', reportProgress?: boolean): Observable; public uploadRulesFileForm( dossierTemplateId: string, @@ -279,9 +206,7 @@ export class RulesControllerService { reportProgress: boolean = false ): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling uploadRulesFile.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadRulesFile.'); } let headers = this.defaultHeaders; @@ -289,16 +214,13 @@ export class RulesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -324,17 +246,13 @@ export class RulesControllerService { formParams = (formParams.append('file', file) as any) || formParams; } - return this.httpClient.request( - 'post', - `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/upload`, - { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/upload`, { + body: convertFormParamsToString ? formParams.toString() : formParams, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** 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 3c88f814d..b628aa76b 100644 --- a/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts +++ b/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts @@ -48,35 +48,23 @@ export class SmtpConfigurationControllerService { */ public clearSMTPConfiguration(observe?: 'body', reportProgress?: boolean): Observable; - public clearSMTPConfiguration( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public clearSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - public clearSMTPConfiguration( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public clearSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - public clearSMTPConfiguration( - observe: any = 'body', - reportProgress: boolean = false - ): 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; + 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); } @@ -95,54 +83,35 @@ 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?: 'body', reportProgress?: boolean): Observable; - public getCurrentSMTPConfiguration( - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public getCurrentSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - public getCurrentSMTPConfiguration( - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getCurrentSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - public getCurrentSMTPConfiguration( - observe: any = 'body', - reportProgress: boolean = false - ): 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; + 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( - '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 + }); } /** @@ -152,11 +121,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public testSMTPConfiguration( body: SMTPConfigurationModel, @@ -164,21 +129,11 @@ export class SmtpConfigurationControllerService { reportProgress?: boolean ): Observable>; - public testSMTPConfiguration( - body: SMTPConfigurationModel, - observe?: 'events', - 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: 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; @@ -186,24 +141,20 @@ export class SmtpConfigurationControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -224,11 +175,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public updateSMTPConfiguration( body: SMTPConfigurationModel, @@ -236,21 +183,11 @@ export class SmtpConfigurationControllerService { reportProgress?: boolean ): Observable>; - public updateSMTPConfiguration( - body: SMTPConfigurationModel, - observe?: 'events', - 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: 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; @@ -258,24 +195,20 @@ export class SmtpConfigurationControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/statusController.service.ts b/libs/red-ui-http/src/lib/api/statusController.service.ts index d6cbfe094..43b06ba9c 100644 --- a/libs/red-ui-http/src/lib/api/statusController.service.ts +++ b/libs/red-ui-http/src/lib/api/statusController.service.ts @@ -48,33 +48,15 @@ export class StatusControllerService { * @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 getDossierStatus( - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable>; + public getDossierStatus(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable>; - public getDossierStatus( - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>>; + public getDossierStatus(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>>; - public getDossierStatus( - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>>; + public getDossierStatus(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>>; - public getDossierStatus( - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getDossierStatus(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getDossierStatus.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getDossierStatus.'); } let headers = this.defaultHeaders; @@ -82,30 +64,23 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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>( - 'get', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request>('get', `${this.basePath}/status/${encodeURIComponent(String(dossierId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -116,12 +91,7 @@ export class StatusControllerService { * @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 getFileStatus( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getFileStatus(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getFileStatus( dossierId: string, @@ -137,22 +107,13 @@ export class StatusControllerService { reportProgress?: boolean ): Observable>; - public getFileStatus( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getFileStatus(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getFileStatus.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getFileStatus.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getFileStatus.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getFileStatus.'); } let headers = this.defaultHeaders; @@ -160,25 +121,20 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId) - )}`, + `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -213,15 +169,9 @@ export class StatusControllerService { reportProgress?: boolean ): Observable }>>; - public getFileStatusForDossiers( - body: Array, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getFileStatusForDossiers(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling getFileStatusForDossiers.' - ); + throw new Error('Required parameter body was null or undefined when calling getFileStatusForDossiers.'); } let headers = this.defaultHeaders; @@ -229,39 +179,31 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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<{ [key: string]: Array }>( - 'post', - `${this.basePath}/status`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request<{ [key: string]: Array }>('post', `${this.basePath}/status`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -305,21 +247,15 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setFileReviewer.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setFileReviewer.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling setFileReviewer.' - ); + throw new Error('Required parameter fileId was null or undefined when calling setFileReviewer.'); } if (reviewerId === null || reviewerId === undefined) { - throw new Error( - 'Required parameter reviewerId was null or undefined when calling setFileReviewer.' - ); + throw new Error('Required parameter reviewerId was null or undefined when calling setFileReviewer.'); } let headers = this.defaultHeaders; @@ -327,25 +263,22 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId) - )}/${encodeURIComponent(String(reviewerId))}`, + `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent( + String(reviewerId) + )}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -396,21 +329,15 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setFileReviewerForList.' - ); + throw new Error('Required parameter body was null or undefined when calling setFileReviewerForList.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setFileReviewerForList.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setFileReviewerForList.'); } if (reviewerId === null || reviewerId === undefined) { - throw new Error( - 'Required parameter reviewerId was null or undefined when calling setFileReviewerForList.' - ); + throw new Error('Required parameter reviewerId was null or undefined when calling setFileReviewerForList.'); } let headers = this.defaultHeaders; @@ -418,33 +345,27 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/status/${encodeURIComponent( - String(dossierId) - )}/bulk/${encodeURIComponent(String(reviewerId))}`, + `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/bulk/${encodeURIComponent(String(reviewerId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -463,12 +384,7 @@ export class StatusControllerService { * @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 setStatusApproved( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public setStatusApproved(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public setStatusApproved( dossierId: string, @@ -477,29 +393,15 @@ export class StatusControllerService { reportProgress?: boolean ): Observable>; - public setStatusApproved( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public setStatusApproved(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public setStatusApproved( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public setStatusApproved(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusApproved.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusApproved.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling setStatusApproved.' - ); + throw new Error('Required parameter fileId was null or undefined when calling setStatusApproved.'); } let headers = this.defaultHeaders; @@ -507,25 +409,20 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/status/approved/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/status/approved/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -543,12 +440,7 @@ export class StatusControllerService { * @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 setStatusApprovedForList( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public setStatusApprovedForList(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; public setStatusApprovedForList( body: Array, @@ -571,15 +463,11 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setStatusApprovedForList.' - ); + throw new Error('Required parameter body was null or undefined when calling setStatusApprovedForList.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusApprovedForList.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusApprovedForList.'); } let headers = this.defaultHeaders; @@ -587,39 +475,31 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/status/approved/${encodeURIComponent(String(dossierId))}/bulk`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/status/approved/${encodeURIComponent(String(dossierId))}/bulk`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -663,15 +543,11 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusUnderApproval.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderApproval.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling setStatusUnderApproval.' - ); + throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderApproval.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -684,25 +560,20 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/status/underapproval/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/status/underapproval/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -754,21 +625,15 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setStatusUnderApprovalForList.' - ); + throw new Error('Required parameter body was null or undefined when calling setStatusUnderApprovalForList.'); } if (approverId === null || approverId === undefined) { - throw new Error( - 'Required parameter approverId was null or undefined when calling setStatusUnderApprovalForList.' - ); + throw new Error('Required parameter approverId was null or undefined when calling setStatusUnderApprovalForList.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusUnderApprovalForList.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderApprovalForList.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -781,40 +646,32 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/status/underapproval/${encodeURIComponent(String(dossierId))}/bulk`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/status/underapproval/${encodeURIComponent(String(dossierId))}/bulk`, { + body: body, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -825,12 +682,7 @@ export class StatusControllerService { * @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 setStatusUnderReview( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public setStatusUnderReview(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public setStatusUnderReview( dossierId: string, @@ -853,15 +705,11 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusUnderReview.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderReview.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling setStatusUnderReview.' - ); + throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderReview.'); } let headers = this.defaultHeaders; @@ -869,25 +717,20 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'post', - `${this.basePath}/status/underreview/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/status/underreview/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -905,12 +748,7 @@ export class StatusControllerService { * @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 setStatusUnderReviewForList( - body: Array, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public setStatusUnderReviewForList(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; public setStatusUnderReviewForList( body: Array, @@ -933,15 +771,11 @@ export class StatusControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling setStatusUnderReviewForList.' - ); + throw new Error('Required parameter body was null or undefined when calling setStatusUnderReviewForList.'); } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling setStatusUnderReviewForList.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderReviewForList.'); } let headers = this.defaultHeaders; @@ -949,38 +783,30 @@ export class StatusControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/status/underreview/${encodeURIComponent(String(dossierId))}/bulk`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/status/underreview/${encodeURIComponent(String(dossierId))}/bulk`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } } diff --git a/libs/red-ui-http/src/lib/api/uploadController.service.ts b/libs/red-ui-http/src/lib/api/uploadController.service.ts index 439ce3506..502792cf5 100644 --- a/libs/red-ui-http/src/lib/api/uploadController.service.ts +++ b/libs/red-ui-http/src/lib/api/uploadController.service.ts @@ -49,12 +49,7 @@ export class UploadControllerService { * @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 uploadFileForm( - dossierId: string, - file?: Blob, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public uploadFileForm(dossierId: string, file?: Blob, observe?: 'body', reportProgress?: boolean): Observable; public uploadFileForm( dossierId: string, @@ -70,16 +65,9 @@ export class UploadControllerService { reportProgress?: boolean ): Observable>; - public uploadFileForm( - dossierId: string, - file?: Blob, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public uploadFileForm(dossierId: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling uploadFile.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling uploadFile.'); } let headers = this.defaultHeaders; @@ -87,16 +75,13 @@ export class UploadControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -122,17 +107,13 @@ export class UploadControllerService { formParams = (formParams.append('file', file) as any) || formParams; } - return this.httpClient.request( - 'post', - `${this.basePath}/upload/${encodeURIComponent(String(dossierId))}`, - { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/upload/${encodeURIComponent(String(dossierId))}`, { + body: convertFormParamsToString ? formParams.toString() : formParams, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** 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 90d13f363..f7be77a31 100644 --- a/libs/red-ui-http/src/lib/api/userController.service.ts +++ b/libs/red-ui-http/src/lib/api/userController.service.ts @@ -53,12 +53,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public addRoleToUsers( body: Array, @@ -67,29 +62,15 @@ export class UserControllerService { reportProgress?: boolean ): Observable>; - public addRoleToUsers( - body: Array, - userId: string, - observe?: 'events', - 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: 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; @@ -97,39 +78,31 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 + }); } /** @@ -139,33 +112,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public createUser( - body: CreateUserRequest, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public createUser( - body: CreateUserRequest, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -173,24 +128,20 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -213,27 +164,13 @@ export class UserControllerService { */ public deleteUser(userId: string, observe?: 'body', reportProgress?: boolean): Observable; - public deleteUser( - userId: string, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public deleteUser( - userId: string, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -241,30 +178,23 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/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 + }); } /** @@ -274,33 +204,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public deleteUsers( - userId: Array, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public deleteUsers( - userId: Array, - observe: any = 'body', - reportProgress: boolean = false - ): 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() }); @@ -315,16 +227,13 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -345,29 +254,13 @@ 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?: 'body', reportProgress?: boolean): Observable>; - public getAllUsers( - refreshCache?: boolean, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>>; - public getAllUsers( - refreshCache?: boolean, - observe: any = 'body', - reportProgress: boolean = false - ): 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); @@ -378,16 +271,13 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -408,33 +298,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public getUserById( - userId: string, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public getUserById( - userId: string, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -442,30 +314,23 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( - '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 + }); } /** @@ -475,29 +340,13 @@ 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?: 'body', reportProgress?: boolean): Observable>; - public getUsers( - refreshCache?: boolean, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>>; - public getUsers( - refreshCache?: boolean, - observe: any = 'body', - reportProgress: boolean = false - ): 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); @@ -508,16 +357,13 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -539,12 +385,7 @@ 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 resetPassword( - body: ResetPasswordRequest, - userId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public resetPassword(body: ResetPasswordRequest, userId: string, observe?: 'body', reportProgress?: boolean): Observable; public resetPassword( body: ResetPasswordRequest, @@ -567,15 +408,11 @@ export class UserControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling resetPassword.' - ); + throw new Error('Required parameter body was null or undefined when calling resetPassword.'); } if (userId === null || userId === undefined) { - throw new Error( - 'Required parameter userId was null or undefined when calling resetPassword.' - ); + throw new Error('Required parameter userId was null or undefined when calling resetPassword.'); } let headers = this.defaultHeaders; @@ -583,39 +420,31 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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))}/reset-password`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('post', `${this.basePath}/user/${encodeURIComponent(String(userId))}/reset-password`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -625,33 +454,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public updateMyProfile( - body: UpdateMyProfileRequest, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public updateMyProfile( - body: UpdateMyProfileRequest, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -659,24 +470,20 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -698,12 +505,7 @@ 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?: 'body', reportProgress?: boolean): Observable; public updateProfile( body: UpdateProfileRequest, @@ -726,15 +528,11 @@ export class UserControllerService { 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; @@ -742,38 +540,30 @@ export class UserControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 56502f06d..3496ca8aa 100644 --- a/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts +++ b/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts @@ -45,33 +45,15 @@ 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?: 'body', reportProgress?: boolean): Observable; - public deletePreferences( - key: string, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public deletePreferences( - key: string, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -79,30 +61,23 @@ export class UserPreferenceControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 + }); } /** @@ -111,54 +86,35 @@ 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?: 'body', reportProgress?: boolean): Observable<{ [key: string]: Array }>; - public getAllUserAttributes( - observe?: 'response', - reportProgress?: boolean - ): Observable }>>; + public getAllUserAttributes(observe?: 'response', reportProgress?: boolean): Observable }>>; - public getAllUserAttributes( - observe?: 'events', - reportProgress?: boolean - ): Observable }>>; + public getAllUserAttributes(observe?: 'events', reportProgress?: boolean): Observable }>>; - public getAllUserAttributes( - observe: any = 'body', - reportProgress: boolean = false - ): 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; + 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 + }); } /** @@ -169,43 +125,19 @@ 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?: 'body', reportProgress?: boolean): Observable; - public savePreferences( - body: Array, - key: string, - observe?: 'response', - 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?: 'events', reportProgress?: boolean): Observable>; - public savePreferences( - body: Array, - key: string, - observe: any = 'body', - reportProgress: boolean = false - ): 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; @@ -213,38 +145,30 @@ export class UserPreferenceControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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 73d201b79..7232b1106 100644 --- a/libs/red-ui-http/src/lib/api/versionsController.service.ts +++ b/libs/red-ui-http/src/lib/api/versionsController.service.ts @@ -77,15 +77,11 @@ export class VersionsControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getDossierDictionaryVersion.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getDossierDictionaryVersion.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getDossierDictionaryVersion.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierDictionaryVersion.'); } let headers = this.defaultHeaders; @@ -93,25 +89,20 @@ export class VersionsControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/version/dossier/${encodeURIComponent( - String(dossierTemplateId) - )}/${encodeURIComponent(String(dossierId))}`, + `${this.basePath}/version/dossier/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(dossierId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -146,15 +137,9 @@ export class VersionsControllerService { reportProgress?: boolean ): Observable>; - public getVersions( - dossierTemplateId: Array, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getVersions(dossierTemplateId: Array, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getVersions.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getVersions.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); @@ -169,30 +154,23 @@ export class VersionsControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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<{ [key: string]: VersionsResponse }>( - 'get', - `${this.basePath}/version`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request<{ [key: string]: VersionsResponse }>('get', `${this.basePath}/version`, { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } } diff --git a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts b/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts index f5ad9b03d..dfe0202ee 100644 --- a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts +++ b/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts @@ -86,15 +86,11 @@ export class ViewedPagesControllerService { } if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling addPage.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling addPage.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling addPage.' - ); + throw new Error('Required parameter fileId was null or undefined when calling addPage.'); } let headers = this.defaultHeaders; @@ -102,33 +98,27 @@ export class ViewedPagesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/viewedPages/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -147,12 +137,7 @@ export class ViewedPagesControllerService { * @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 getViewedPages( - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getViewedPages(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public getViewedPages( dossierId: string, @@ -168,22 +153,13 @@ export class ViewedPagesControllerService { reportProgress?: boolean ): Observable>; - public getViewedPages( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getViewedPages(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling getViewedPages.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling getViewedPages.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling getViewedPages.' - ); + throw new Error('Required parameter fileId was null or undefined when calling getViewedPages.'); } let headers = this.defaultHeaders; @@ -191,25 +167,20 @@ export class ViewedPagesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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( 'get', - `${this.basePath}/viewedPages/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, + `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -228,13 +199,7 @@ export class ViewedPagesControllerService { * @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 removePage( - dossierId: string, - fileId: string, - page: number, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public removePage(dossierId: string, fileId: string, page: number, observe?: 'body', reportProgress?: boolean): Observable; public removePage( dossierId: string, @@ -260,21 +225,15 @@ export class ViewedPagesControllerService { reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling removePage.' - ); + throw new Error('Required parameter dossierId was null or undefined when calling removePage.'); } if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling removePage.' - ); + throw new Error('Required parameter fileId was null or undefined when calling removePage.'); } if (page === null || page === undefined) { - throw new Error( - 'Required parameter page was null or undefined when calling removePage.' - ); + throw new Error('Required parameter page was null or undefined when calling removePage.'); } let headers = this.defaultHeaders; @@ -282,25 +241,22 @@ export class ViewedPagesControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/viewedPages/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(page))}`, + `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( + String(fileId) + )}/${encodeURIComponent(String(page))}`, { withCredentials: this.configuration.withCredentials, headers: headers, diff --git a/libs/red-ui-http/src/lib/api/watermarkController.service.ts b/libs/red-ui-http/src/lib/api/watermarkController.service.ts index 0e3f7536d..f5c2db566 100644 --- a/libs/red-ui-http/src/lib/api/watermarkController.service.ts +++ b/libs/red-ui-http/src/lib/api/watermarkController.service.ts @@ -48,33 +48,15 @@ export class WatermarkControllerService { * @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 deleteWatermark( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public deleteWatermark(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - public deleteWatermark( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; + public deleteWatermark(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - public deleteWatermark( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public deleteWatermark(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public deleteWatermark( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public deleteWatermark(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling deleteWatermark.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteWatermark.'); } let headers = this.defaultHeaders; @@ -82,30 +64,23 @@ export class WatermarkControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); + return this.httpClient.request('delete', `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); } /** @@ -115,11 +90,7 @@ export class WatermarkControllerService { * @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 getWatermark( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; + public getWatermark(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; public getWatermark( dossierTemplateId: string, @@ -127,21 +98,11 @@ export class WatermarkControllerService { reportProgress?: boolean ): Observable>; - public getWatermark( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; + public getWatermark(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - public getWatermark( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { + public getWatermark(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling getWatermark.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling getWatermark.'); } let headers = this.defaultHeaders; @@ -149,16 +110,13 @@ export class WatermarkControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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); } @@ -211,15 +169,11 @@ export class WatermarkControllerService { reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { - throw new Error( - 'Required parameter body was null or undefined when calling saveWatermark.' - ); + throw new Error('Required parameter body was null or undefined when calling saveWatermark.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error( - 'Required parameter dossierTemplateId was null or undefined when calling saveWatermark.' - ); + throw new Error('Required parameter dossierTemplateId was null or undefined when calling saveWatermark.'); } let headers = this.defaultHeaders; @@ -227,24 +181,20 @@ export class WatermarkControllerService { // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = - typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.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/configuration.ts b/libs/red-ui-http/src/lib/configuration.ts index d43dea327..ff7fb826b 100644 --- a/libs/red-ui-http/src/lib/configuration.ts +++ b/libs/red-ui-http/src/lib/configuration.ts @@ -73,13 +73,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - '^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', - 'i' - ); - return ( - mime !== null && - (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json') - ); + const jsonMime: RegExp = new RegExp('^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } } diff --git a/libs/red-ui-http/src/lib/model/dossier.ts b/libs/red-ui-http/src/lib/model/dossier.ts index 66668b2e5..494e25386 100644 --- a/libs/red-ui-http/src/lib/model/dossier.ts +++ b/libs/red-ui-http/src/lib/model/dossier.ts @@ -30,12 +30,7 @@ export interface Dossier { } export namespace Dossier { - export type DownloadFileTypesEnum = - | 'ANNOTATED' - | 'FLATTEN' - | 'ORIGINAL' - | 'PREVIEW' - | 'REDACTED'; + export type DownloadFileTypesEnum = 'ANNOTATED' | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' | 'REDACTED'; export const DownloadFileTypesEnum = { ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, @@ -53,8 +48,7 @@ export namespace Dossier { EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, WORDSINGLEFILE: 'WORD_SINGLE_FILE' as ReportTypesEnum, - WORDSINGLEFILEAPPENDIXA1TEMPLATE: - 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA1TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; export type StatusEnum = 'ACTIVE' | 'DELETED'; diff --git a/libs/red-ui-http/src/lib/model/dossierRequest.ts b/libs/red-ui-http/src/lib/model/dossierRequest.ts index 831598926..e04bfe3f9 100644 --- a/libs/red-ui-http/src/lib/model/dossierRequest.ts +++ b/libs/red-ui-http/src/lib/model/dossierRequest.ts @@ -65,12 +65,7 @@ export interface DossierRequest { } export namespace DossierRequest { - export type DownloadFileTypesEnum = - | 'ANNOTATED' - | 'FLATTEN' - | 'ORIGINAL' - | 'PREVIEW' - | 'REDACTED'; + export type DownloadFileTypesEnum = 'ANNOTATED' | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' | 'REDACTED'; export const DownloadFileTypesEnum = { ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, @@ -88,8 +83,7 @@ export namespace DossierRequest { EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, WORDSINGLEFILE: 'WORD_SINGLE_FILE' as ReportTypesEnum, - WORDSINGLEFILEAPPENDIXA1TEMPLATE: - 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA1TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; } diff --git a/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts b/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts index ea2ccecea..4b3fcfdfb 100644 --- a/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts +++ b/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts @@ -58,12 +58,7 @@ export interface DossierTemplateModel { } export namespace DossierTemplateModel { - export type DownloadFileTypesEnum = - | 'ANNOTATED' - | 'FLATTEN' - | 'ORIGINAL' - | 'PREVIEW' - | 'REDACTED'; + export type DownloadFileTypesEnum = 'ANNOTATED' | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' | 'REDACTED'; export const DownloadFileTypesEnum = { ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, @@ -79,8 +74,7 @@ export namespace DossierTemplateModel { export const ReportTypesEnum = { EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, - WORDSINGLEFILEAPPENDIXA1TEMPLATE: - 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA1TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; } diff --git a/libs/red-ui-http/src/lib/model/downloadDetails.ts b/libs/red-ui-http/src/lib/model/downloadDetails.ts index 410063eda..801cc4afc 100644 --- a/libs/red-ui-http/src/lib/model/downloadDetails.ts +++ b/libs/red-ui-http/src/lib/model/downloadDetails.ts @@ -18,12 +18,7 @@ export interface DownloadDetails { } export namespace DownloadDetails { - export type DownloadFileTypesEnum = - | 'ANNOTATED' - | 'FLATTEN' - | 'ORIGINAL' - | 'PREVIEW' - | 'REDACTED'; + export type DownloadFileTypesEnum = 'ANNOTATED' | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' | 'REDACTED'; export const DownloadFileTypesEnum = { ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, @@ -41,8 +36,7 @@ export namespace DownloadDetails { EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, WORDSINGLEFILE: 'WORD_SINGLE_FILE' as ReportTypesEnum, - WORDSINGLEFILEAPPENDIXA1TEMPLATE: - 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA1TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; } From d7aeb7fbdde8ed87b184b58b287a886411ec759e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 19 Jul 2021 19:27:27 +0300 Subject: [PATCH 06/25] Translation rework: Circle button --- .../downloads-list-screen.component.html | 6 +-- .../dossier-template-actions.component.html | 4 +- .../users-stats/users-stats.component.html | 4 +- .../add-edit-dictionary-dialog.component.html | 10 ++-- ...it-dossier-attribute-dialog.component.html | 2 +- ...dit-dossier-template-dialog.component.html | 4 +- ...-edit-file-attribute-dialog.component.html | 4 +- .../edit-color-dialog.component.html | 2 +- .../active-fields-listing.component.html | 12 ++--- ...ttributes-csv-import-dialog.component.html | 7 ++- .../smtp-auth-dialog.component.html | 2 +- .../screens/audit/audit-screen.component.html | 2 +- .../default-colors-screen.component.html | 4 +- .../dictionary-listing-screen.component.html | 8 ++-- .../dictionary-overview-screen.component.html | 10 ++-- .../digital-signature-screen.component.html | 2 +- ...r-attributes-listing-screen.component.html | 8 ++-- ...er-templates-listing-screen.component.html | 4 +- ...e-attributes-listing-screen.component.html | 10 ++-- .../license-information-screen.component.html | 2 +- .../reports/reports-screen.component.html | 4 +- .../screens/rules/rules-screen.component.html | 2 +- .../smtp-config-screen.component.html | 14 +++--- .../user-listing-screen.component.html | 12 +++-- .../watermark/watermark-screen.component.html | 4 +- .../annotation-actions.component.html | 48 +++++++++---------- ...ssier-overview-bulk-actions.component.html | 16 +++---- ...dossier-overview-bulk-actions.component.ts | 8 +++- .../document-info.component.html | 4 +- .../dossier-details.component.html | 16 ++++--- .../dossier-listing-actions.component.html | 4 +- .../file-actions/file-actions.component.html | 26 +++++----- .../file-actions/file-actions.component.ts | 8 +++- .../file-workload.component.html | 8 ++-- .../page-exclusion.component.html | 4 +- .../team-members/team-members.component.html | 2 +- .../edit-dossier-attributes.component.html | 4 +- .../file-preview-screen.component.html | 14 +++--- .../file-preview-screen.component.ts | 8 +++- .../assign-user-dropdown.component.html | 6 +-- .../circle-button.component.html | 2 +- .../file-download-btn.component.html | 2 +- .../file-download-btn.component.ts | 6 +++ .../dictionary-manager.component.html | 2 +- .../page-header/page-header.component.html | 2 +- .../simple-doughnut-chart.component.html | 22 ++++----- .../upload-status-overlay.component.html | 4 +- 47 files changed, 193 insertions(+), 166 deletions(-) diff --git a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html index 27d023fa7..4e159a38e 100644 --- a/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html +++ b/apps/red-ui/src/app/components/downloads-list-screen/downloads-list-screen.component.html @@ -2,9 +2,9 @@ diff --git a/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html b/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html index b06beffe0..d3e45d454 100644 --- a/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html +++ b/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html @@ -1,8 +1,8 @@
@@ -12,8 +12,8 @@
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html index e8764f5ca..f0693271a 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html @@ -5,7 +5,7 @@
-
+
{{ dictionary.label }}
@@ -14,9 +14,9 @@
@@ -25,9 +25,9 @@
@@ -35,10 +35,10 @@
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html index 3062a8234..a27a36051 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html @@ -11,9 +11,9 @@
@@ -21,9 +21,9 @@
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html index d0ae645aa..369f6468f 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html @@ -6,10 +6,10 @@
@@ -109,22 +109,22 @@ @@ -151,8 +151,8 @@
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html index 563d951b1..505d781f2 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html @@ -51,8 +51,8 @@
@@ -109,7 +109,10 @@ {{ field.csvColumn }}
-
{{ getEntries(field.csvColumn) }} entries
+
+ {{ getEntries(field.csvColumn) }} + entries +
Sample: {{ getSample(field.csvColumn) }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html index e0d23d62e..233615737 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/smtp-auth-dialog/smtp-auth-dialog.component.html @@ -6,9 +6,9 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 14cade35c..a58289d6e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -10,10 +10,10 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html index 2d0c03531..5ea4f8ae5 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html @@ -7,8 +7,8 @@
@@ -63,8 +63,8 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index 943bd9172..713fce6cc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -7,8 +7,8 @@
@@ -36,8 +36,8 @@ @@ -142,15 +142,15 @@
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 1d27cbb25..52eb89937 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 @@ -6,8 +6,8 @@ @@ -15,24 +15,24 @@ @@ -40,9 +40,9 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html index 1667b8727..de42692ed 100644 --- a/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html @@ -10,10 +10,10 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index bcef46bc0..5475afb04 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -7,8 +7,8 @@
@@ -36,8 +36,8 @@ @@ -115,15 +115,15 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index 2620741c1..1983c630a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -9,9 +9,9 @@
@@ -35,8 +35,8 @@ diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 7d11195a7..da001f604 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -7,8 +7,8 @@
@@ -36,8 +36,8 @@ @@ -53,8 +53,8 @@ @@ -155,15 +155,15 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html index 65a6079d4..bbdd0c7ba 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html @@ -11,10 +11,10 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html index ab6ea2b2f..118929ae0 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html @@ -7,8 +7,8 @@
@@ -47,8 +47,8 @@
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 dc97529c9..66b8b7847 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 @@ -7,8 +7,8 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html index a7a43ce4f..c73b070cf 100644 --- a/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/smtp-config/smtp-config-screen.component.html @@ -10,10 +10,10 @@
@@ -59,9 +59,9 @@
@@ -74,9 +74,9 @@
@@ -84,9 +84,9 @@
@@ -95,9 +95,9 @@
@@ -105,9 +105,9 @@
@@ -115,9 +115,9 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html index 7f6c0fc3d..df3f6ec46 100644 --- a/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html @@ -22,10 +22,10 @@ >
@@ -50,7 +50,11 @@ (action)="bulkDelete()" *ngIf="areSomeEntitiesSelected$ | async" [disabled]="(canDeleteSelected$ | async) === false" - [tooltip]="(canDeleteSelected$ | async) ? 'user-listing.bulk.delete' : 'user-listing.bulk.delete-disabled'" + [tooltip]=" + (canDeleteSelected$ | async) + ? ('user-listing.bulk.delete' | translate) + : ('user-listing.bulk.delete-disabled' | translate) + " icon="red:trash" tooltipPosition="after" type="dark-bg" @@ -107,15 +111,15 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html index 3450226a8..40f32fa43 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html @@ -7,8 +7,8 @@
@@ -77,10 +77,10 @@
+
@@ -103,9 +103,9 @@ (action)="suggestRemoveAnnotations($event, true)" *ngIf="annotationPermissions.canRemoveOrSuggestToRemoveFromDictionary" [tooltipPosition]="tooltipPosition" + [tooltip]="'annotation-actions.remove-annotation.remove-from-dict' | translate" [type]="btnType" icon="red:remove-from-dict" - tooltip="annotation-actions.remove-annotation.remove-from-dict" > @@ -113,9 +113,9 @@ (action)="markAsFalsePositive($event)" *ngIf="annotationPermissions.canMarkAsFalsePositive" [tooltipPosition]="tooltipPosition" + [tooltip]="'annotation-actions.remove-annotation.false-positive' | translate" [type]="btnType" icon="red:thumb-down" - tooltip="annotation-actions.remove-annotation.false-positive" > @@ -123,9 +123,9 @@ (action)="suggestRemoveAnnotations($event, false)" *ngIf="annotationPermissions.canRemoveOrSuggestToRemoveOnlyHere" [tooltipPosition]="tooltipPosition" + [tooltip]="'annotation-actions.remove-annotation.only-here' | translate" [type]="btnType" icon="red:trash" - tooltip="annotation-actions.remove-annotation.only-here" >
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 4b2b05229..9c41e2e5d 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 @@ -2,8 +2,8 @@ @@ -18,8 +18,8 @@ @@ -27,8 +27,8 @@ @@ -36,8 +36,8 @@ @@ -49,7 +49,7 @@ (action)="approveDocuments()" *ngIf="isReadyForApproval" [disabled]="!canApprove" - [tooltip]="canApprove ? 'dossier-overview.approve' : 'dossier-overview.approve-disabled'" + [tooltip]="canApprove ? ('dossier-overview.approve' | translate) : ('dossier-overview.approve-disabled' | translate)" icon="red:approved" type="dark-bg" > @@ -59,8 +59,8 @@ @@ -68,16 +68,16 @@ 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 47f2dfe2b..02053f8dd 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 @@ -10,6 +10,7 @@ import { StatusOverlayService } from '@upload-download/services/status-overlay.s import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { LoadingService } from '@services/loading.service'; import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'redaction-dossier-overview-bulk-actions', @@ -32,7 +33,8 @@ export class DossierOverviewBulkActionsComponent { private readonly _fileActionService: FileActionService, private readonly _statusOverlayService: StatusOverlayService, private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _loadingService: LoadingService + private readonly _loadingService: LoadingService, + private readonly _translateService: TranslateService ) {} get dossier() { @@ -125,7 +127,9 @@ export class DossierOverviewBulkActionsComponent { get assignTooltip() { const allFilesAreUnderApproval = this.selectedFiles.reduce((acc, file) => acc && file.isUnderApproval, true); - return allFilesAreUnderApproval ? 'dossier-overview.assign-approver' : 'dossier-overview.assign-reviewer'; + return allFilesAreUnderApproval + ? this._translateService.instant('dossier-overview.assign-approver') + : this._translateService.instant('dossier-overview.assign-reviewer'); } delete() { diff --git a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html index 0558d76b6..bd02b1ad1 100644 --- a/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/document-info/document-info.component.html @@ -2,14 +2,14 @@
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 da86fc640..62a7c0101 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 @@ -1,12 +1,16 @@
- +
{{ appStateService.activeDossier.dossier.dossierName }}
- +
@@ -18,9 +22,9 @@ @@ -80,11 +84,11 @@ > - + 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 382643c84..b78c711d0 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 @@ -3,16 +3,16 @@ 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 0f339b53a..888a9b680 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 @@ -14,9 +14,9 @@ (action)="openDeleteFileDialog($event)" *ngIf="permissionsService.canDeleteFile(fileStatus)" [tooltipPosition]="tooltipPosition" + [tooltip]="'dossier-overview.delete.action' | translate" [type]="buttonType" icon="red:trash" - tooltip="dossier-overview.delete.action" > @@ -50,8 +50,8 @@ (action)="toggleViewDocumentInfo()" *ngIf="screen === 'file-preview'" [attr.aria-expanded]="activeDocumentInfo" + [tooltip]="'file-preview.document-info' | translate" icon="red:status-info" - tooltip="file-preview.document-info" tooltipPosition="below" > @@ -60,8 +60,8 @@ *ngIf="screen === 'file-preview'" [attr.aria-expanded]="activeExcludePages" [showDot]="!!fileStatus.excludedPages?.length" + [tooltip]="'file-preview.exclude-pages' | translate" icon="red:exclude-pages" - tooltip="file-preview.exclude-pages" tooltipPosition="below" > @@ -70,9 +70,9 @@ (action)="setFileUnderApproval($event)" *ngIf="canSetToUnderApproval" [tooltipPosition]="tooltipPosition" + [tooltip]="'dossier-overview.under-approval' | translate" [type]="buttonType" icon="red:ready-for-approval" - tooltip="dossier-overview.under-approval" > @@ -80,9 +80,9 @@ (action)="setFileUnderReview($event, true)" *ngIf="canSetToUnderReview" [tooltipPosition]="tooltipPosition" + [tooltip]="'dossier-overview.under-review' | translate" [type]="buttonType" icon="red:undo" - tooltip="dossier-overview.under-review" > @@ -91,7 +91,11 @@ *ngIf="permissionsService.isReadyForApproval(fileStatus)" [disabled]="!permissionsService.canApprove(fileStatus)" [tooltipPosition]="tooltipPosition" - [tooltip]="permissionsService.canApprove(fileStatus) ? 'dossier-overview.approve' : 'dossier-overview.approve-disabled'" + [tooltip]=" + permissionsService.canApprove(fileStatus) + ? ('dossier-overview.approve' | translate) + : ('dossier-overview.approve-disabled' | translate) + " [type]="buttonType" icon="red:approved" > @@ -101,26 +105,26 @@ (action)="setFileUnderApproval($event)" *ngIf="canUndoApproval" [tooltipPosition]="tooltipPosition" + [tooltip]="'dossier-overview.under-approval' | translate" [type]="buttonType" icon="red:undo" - tooltip="dossier-overview.under-approval" > diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts index b5820b64e..f988ce319 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts @@ -7,6 +7,7 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component'; import { LoadingService } from '@services/loading.service'; import { FileManagementControllerService } from '@redaction/red-ui-http'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'redaction-file-actions', @@ -28,7 +29,8 @@ export class FileActionsComponent implements OnInit { private readonly _dialogService: DossiersDialogService, private readonly _fileActionService: FileActionService, private readonly _loadingService: LoadingService, - private readonly _fileManagementControllerService: FileManagementControllerService + private readonly _fileManagementControllerService: FileManagementControllerService, + private readonly _translateService: TranslateService ) {} get statusBarConfig() { @@ -84,7 +86,9 @@ export class FileActionsComponent implements OnInit { } get assignTooltip() { - return this.fileStatus.isUnderApproval ? 'dossier-overview.assign-approver' : 'dossier-overview.assign-reviewer'; + return this.fileStatus.isUnderApproval + ? this._translateService.instant('dossier-overview.assign-approver') + : this._translateService.instant('dossier-overview.assign-reviewer'); } ngOnInit(): void { diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html index 396cd8b6d..3432287b6 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html @@ -20,8 +20,8 @@
@@ -99,7 +99,7 @@
-
+
{{ activeViewerPage }} - {{ activeAnnotationsLength || 0 }} @@ -165,10 +165,10 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html index 771164b19..8e3605d22 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.html @@ -20,12 +20,12 @@ {{ range.startPage }} - {{ range.startPage }}-{{ range.endPage }} + {{ range.startPage }} -{{ range.endPage }}
diff --git a/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html b/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html index 08774a997..026b87721 100644 --- a/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/team-members/team-members.component.html @@ -19,9 +19,9 @@ *ngIf="permissionsService.isManager() && canAdd" [class.large-spacing]="largeSpacing" [size]="32" + [tooltip]="'dossier-details.assign-members' | translate" class="member" icon="red:plus" - tooltip="dossier-details.assign-members" type="primary" > diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html index 4ae754bea..ded16d096 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html @@ -74,14 +74,14 @@
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 f00f3a050..91535d836 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 @@ -32,7 +32,7 @@
- +
{{ status | translate }} @@ -74,8 +74,8 @@
@@ -97,8 +97,8 @@ @@ -106,9 +106,9 @@ @@ -118,9 +118,9 @@ (action)="closeFullScreen()" *ngIf="!fullScreen" [routerLink]="['/main/dossiers/' + appStateService.activeDossierId]" + [tooltip]="'common.close' | translate" class="ml-8" icon="red:close" - tooltip="common.close" tooltipPosition="below" >
@@ -177,17 +177,17 @@ [dialogRef]="dialogRef" [excludePages]="excludePages" [fileData]="fileData" - [viewer]="activeViewer" [hideSkipped]="hideSkipped" [primaryFilters]="primaryFilters" [secondaryFilters]="secondaryFilters" [selectedAnnotations]="selectedAnnotations" + [viewer]="activeViewer" >
- +
diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html index f16c8ed14..84679d1c8 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html index 31ec0b241..a35236909 100644 --- a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -1,23 +1,17 @@
- + diff --git a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html index a4ecde75f..18ed6f268 100644 --- a/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html +++ b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html @@ -42,15 +42,15 @@ From da3b1b1379d377dba5fbb8b5a4b5d20ddbe9a420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 19 Jul 2021 20:19:27 +0300 Subject: [PATCH 07/25] Translation rework: Confirmation dialog, confirm delete users --- ...confirm-delete-users-dialog.component.html | 13 +- .../confirm-delete-users-dialog.component.ts | 9 +- ...dossier-overview-bulk-actions.component.ts | 5 +- .../file-actions/file-actions.component.ts | 5 +- .../pdf-viewer/pdf-viewer.component.ts | 5 +- .../edit-dossier-dialog.component.html | 12 +- .../edit-dossier-dialog.component.ts | 58 ++-- .../services/dossiers-dialog.service.ts | 15 +- .../confirmation-dialog.component.ts | 9 +- apps/red-ui/src/assets/i18n/en.json | 264 +++++++++--------- 10 files changed, 205 insertions(+), 190 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html index 108baa141..0d0eb7328 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html @@ -1,5 +1,5 @@
-
+
@@ -17,15 +17,20 @@ [class.error]="!checkbox.value && showToast" color="primary" > - {{ 'confirm-delete-users.' + checkbox.label | translate: { dossiersCount: dossiersCount } }} + {{ checkbox.label | translate: { dossiersCount: dossiersCount, userCount: users.length } }}
-
+
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 947a2626a..f6ed8044d 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 @@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { User, UserControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { LoadingService } from '@services/loading.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-confirm-delete-users-dialog', @@ -11,8 +12,8 @@ import { LoadingService } from '@services/loading.service'; }) export class ConfirmDeleteUsersDialogComponent { checkboxes = [ - { value: false, label: 'impacted-dossiers' }, - { value: false, label: 'impacted-documents.' + this.type } + { value: false, label: _('confirm-delete-users.impacted-dossiers') }, + { value: false, label: _('confirm-delete-users.impacted-documents') } ]; showToast = false; dossiersCount: number; @@ -38,10 +39,6 @@ export class ConfirmDeleteUsersDialogComponent { return this.checkboxes[0].value && this.checkboxes[1].value; } - get type(): 'bulk' | 'single' { - return this.users.length > 1 ? 'bulk' : 'single'; - } - async deleteUser() { if (this.valid) { this._loadingService.start(); 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 02053f8dd..4ab6bec82 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 @@ -11,6 +11,7 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { LoadingService } from '@services/loading.service'; import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-dossier-overview-bulk-actions', @@ -137,8 +138,8 @@ export class DossierOverviewBulkActionsComponent { 'confirm', null, new ConfirmationDialogInput({ - title: 'confirmation-dialog.delete-file.title', - question: 'confirmation-dialog.delete-file.question' + title: _('confirmation-dialog.delete-file.title'), + question: _('confirmation-dialog.delete-file.question') }), async () => { this._loadingService.start(); diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts index f988ce319..d57fcb2d5 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts @@ -8,6 +8,7 @@ import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/con import { LoadingService } from '@services/loading.service'; import { FileManagementControllerService } from '@redaction/red-ui-http'; import { TranslateService } from '@ngx-translate/core'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-file-actions', @@ -119,8 +120,8 @@ export class FileActionsComponent implements OnInit { 'confirm', $event, new ConfirmationDialogInput({ - title: 'confirmation-dialog.delete-file.title', - question: 'confirmation-dialog.delete-file.question' + title: _('confirmation-dialog.delete-file.title'), + question: _('confirmation-dialog.delete-file.question') }), async () => { this._loadingService.start(); 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 60fb6ff38..19d4ca72a 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 @@ -30,6 +30,7 @@ import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/con import { loadCompareDocumentWrapper } from '../../utils/compare-mode.utils'; import { PdfViewerUtils } from '../../utils/pdf-viewer.utils'; import { ViewMode } from '@models/file/view-mode'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import TextTool = Tools.TextTool; @Component({ @@ -157,8 +158,8 @@ export class PdfViewerComponent implements OnInit, OnChanges { 'confirm', null, new ConfirmationDialogInput({ - title: 'confirmation-dialog.compare-file.title', - question: 'confirmation-dialog.compare-file.question', + title: _('confirmation-dialog.compare-file.title'), + question: _('confirmation-dialog.compare-file.question'), translateParams: { fileName: fileToCompare.name, currentDocumentPageCount, diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html index 1d92fffa5..114bbe926 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/edit-dossier-dialog.component.html @@ -9,14 +9,14 @@ (click)="changeTab(item.key)" *ngFor="let item of navItems" [class.active]="item.key === activeNav" - [translate]="'edit-dossier-dialog.nav-items.' + item.key" + [translate]="item.sideNavTitle || item.title" class="item" >
- {{ 'edit-dossier-dialog.nav-items.' + (activeNavItem.title || activeNavItem.key) | translate }} + {{ activeNavItem.title | translate }}
@@ -31,19 +31,19 @@ @@ -55,7 +55,7 @@
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 99c5b12d9..46f7b73d7 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 @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, Inject, ViewChild } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { FormBuilder } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; -import { DossierWrapper } from '../../../../state/model/dossier.wrapper'; +import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierGeneralInfoComponent } from './general-info/edit-dossier-general-info.component'; import { EditDossierDownloadPackageComponent } from './download-package/edit-dossier-download-package.component'; import { EditDossierSectionInterface } from './edit-dossier-section.interface'; @@ -12,22 +12,16 @@ import { EditDossierDictionaryComponent } from './dictionary/edit-dossier-dictio import { EditDossierTeamMembersComponent } from './team-members/edit-dossier-team-members.component'; import { EditDossierAttributesComponent } from './attributes/edit-dossier-attributes.component'; -type Section = 'dossier-info' | 'download-package' | 'dossier-dictionary' | 'members' | 'dossier-attributes'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +type Section = 'dossierInfo' | 'downloadPackage' | 'dossierDictionary' | 'members' | 'dossierAttributes'; @Component({ templateUrl: './edit-dossier-dialog.component.html', styleUrls: ['./edit-dossier-dialog.component.scss'] }) export class EditDossierDialogComponent { - navItems: { key: Section; title?: string }[] = [ - { key: 'dossier-info', title: 'general-info' }, - { key: 'download-package', title: 'choose-download' }, - { key: 'dossier-dictionary', title: 'dossier-dictionary' }, - { key: 'members', title: 'team-members' }, - { key: 'dossier-attributes' } - // TODO: - // { key: 'report-attributes' } - ]; + readonly navItems: { key: Section; title: string; sideNavTitle?: string }[]; activeNav: Section; dossierWrapper: DossierWrapper; @@ -51,8 +45,34 @@ export class EditDossierDialogComponent { section?: Section; } ) { + this.navItems = [ + { + key: 'dossierInfo', + title: _('edit-dossier-dialog.nav-items.general-info'), + sideNavTitle: _('edit-dossier-dialog.nav-items.dossier-info') + }, + { + key: 'downloadPackage', + title: _('edit-dossier-dialog.nav-items.choose-download'), + sideNavTitle: _('edit-dossier-dialog.nav-items.download-package') + }, + { + key: 'dossierDictionary', + title: _('edit-dossier-dialog.nav-items.dossier-dictionary') + }, + { + key: 'members', + title: _('edit-dossier-dialog.nav-items.team-members'), + sideNavTitle: _('edit-dossier-dialog.nav-items.members') + }, + { + key: 'dossierAttributes', + title: _('edit-dossier-dialog.nav-items.dossier-attributes') + } + ]; + this.dossierWrapper = _data.dossierWrapper; - this.activeNav = _data.section || 'dossier-info'; + this.activeNav = _data.section || 'dossierInfo'; } get activeNavItem(): { key: string; title?: string } { @@ -61,24 +81,24 @@ export class EditDossierDialogComponent { get activeComponent(): EditDossierSectionInterface { return { - 'dossier-info': this.generalInfoComponent, - 'download-package': this.downloadPackageComponent, - 'dossier-dictionary': this.dictionaryComponent, + dossierInfo: this.generalInfoComponent, + downloadPackage: this.downloadPackageComponent, + dossierDictionary: this.dictionaryComponent, members: this.membersComponent, - 'dossier-attributes': this.attributesComponent + dossierAttributes: this.attributesComponent }[this.activeNav]; } get noPaddingTab(): boolean { - return ['dossier-attributes'].includes(this.activeNav); + return ['dossierAttributes'].includes(this.activeNav); } get showHeading(): boolean { - return !['dossier-attributes'].includes(this.activeNav); + return !['dossierAttributes'].includes(this.activeNav); } get showSubtitle(): boolean { - return ['dossier-dictionary'].includes(this.activeNav); + return ['dossierDictionary'].includes(this.activeNav); } updatedDossier(updatedDossier: DossierWrapper) { 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 974f17ace..becdd9247 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 @@ -24,6 +24,7 @@ import { ChangeLegalBasisDialogComponent } from '../dialogs/change-legal-basis-d import { RecategorizeImageDialogComponent } from '../dialogs/recategorize-image-dialog/recategorize-image-dialog.component'; import { DialogService } from '@shared/services/dialog.service'; import { ComponentType } from '@angular/cdk/portal'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; const dialogConfig = { width: '662px', @@ -201,13 +202,13 @@ export class DossiersDialogService extends DialogService { const ref = this._dialog.open(ConfirmationDialogComponent, { ...dialogConfig, data: new ConfirmationDialogInput({ - title: 'confirmation-dialog.delete-dossier.title', + title: _('confirmation-dialog.delete-dossier.title'), titleColor: TitleColors.PRIMARY, - question: 'confirmation-dialog.delete-dossier.question', - // details: 'confirmation-dialog.delete-dossier.details', - confirmationText: 'confirmation-dialog.delete-dossier.confirmation-text', + question: _('confirmation-dialog.delete-dossier.question'), + // details: _('confirmation-dialog.delete-dossier.details'), + confirmationText: _('confirmation-dialog.delete-dossier.confirmation-text'), requireInput: true, - denyText: 'confirmation-dialog.delete-dossier.deny-text', + denyText: _('confirmation-dialog.delete-dossier.deny-text'), translateParams: { dossierName: dossier.dossierName, period: period } }) }); @@ -246,8 +247,8 @@ export class DossiersDialogService extends DialogService { const ref = this._dialog.open(ConfirmationDialogComponent, { ...dialogConfig, data: new ConfirmationDialogInput({ - title: 'confirmation-dialog.assign-file-to-me.title', - question: 'confirmation-dialog.assign-file-to-me.question' + title: _('confirmation-dialog.assign-file-to-me.title'), + question: _('confirmation-dialog.assign-file-to-me.question') }) }); ref.afterClosed().subscribe(result => { diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index 764ff07f7..e631566c6 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, HostListener, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export type TitleColor = 'default' | 'primary'; @@ -20,13 +21,13 @@ export class ConfirmationDialogInput { translateParams?: Record; constructor(options?: ConfirmationDialogInput) { - this.title = options?.title || 'common.confirmation-dialog.title'; + this.title = options?.title || _('common.confirmation-dialog.title'); this.titleColor = options?.titleColor || TitleColors.DEFAULT; - this.question = options?.question || 'common.confirmation-dialog.description'; + this.question = options?.question || _('common.confirmation-dialog.description'); this.details = options?.details || ''; - this.confirmationText = options?.confirmationText || 'common.confirmation-dialog.confirm'; + this.confirmationText = options?.confirmationText || _('common.confirmation-dialog.confirm'); this.requireInput = options?.requireInput || false; - this.denyText = options?.denyText || 'common.confirmation-dialog.deny'; + this.denyText = options?.denyText || _('common.confirmation-dialog.deny'); this.translateParams = options?.translateParams || {}; } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index d6747a580..07c8a0b8d 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1,4 +1,15 @@ { + "APPROVED": "Approved", + "ERROR": "Re-processing required", + "EXCLUDED": "Excluded", + "FULLREPROCESS": "Processing", + "OCR_PROCESSING": "OCR Processing", + "PROCESSING": "Processing", + "REPROCESS": "Processing", + "UNASSIGNED": "Unassigned", + "UNDER_APPROVAL": "Under Approval", + "UNDER_REVIEW": "Under Review", + "UNPROCESSED": "Unprocessed", "actions": { "all": "All", "none": "None" @@ -55,6 +66,22 @@ "new": "Create Dictionary" } }, + "add-edit-dossier-attribute": { + "form": { + "label": "Attribute Name", + "label-placeholder": "Enter Name", + "placeholder": "Attribute Placeholder", + "type": "Attribute Type" + }, + "save": "Save Attribute", + "title": { + "edit": "Edit {name} Dossier Attribute", + "new": "Add New Dossier Attribute" + }, + "error": { + "generic": "Failed to save attribute!" + } + }, "add-edit-dossier-template": { "form": { "description": "Description", @@ -86,22 +113,6 @@ "new": "Add New File Attribute" } }, - "add-edit-dossier-attribute": { - "form": { - "label": "Attribute Name", - "label-placeholder": "Enter Name", - "placeholder": "Attribute Placeholder", - "type": "Attribute Type" - }, - "save": "Save Attribute", - "title": { - "edit": "Edit {name} Dossier Attribute", - "new": "Add New Dossier Attribute" - }, - "error": { - "generic": "Failed to save attribute!" - } - }, "add-edit-user": { "actions": { "cancel": "Cancel", @@ -249,7 +260,6 @@ }, "annotations": "Annotations", "app-name": "DDA-R", - "APPROVED": "Approved", "archived": "Archived", "assign-approver-owner": { "dialog": { @@ -338,34 +348,6 @@ }, "header": "Edit Redaction Reason" }, - "recategorize-image-dialog": { - "actions": { - "cancel": "Cancel", - "save": "Save Changes" - }, - "content": { - "comment": "Comment", - "type": "Select image type", - "type-placeholder": "Select a type..." - }, - "header": "Edit Image Type", - "options": { - "image": "Image", - "logo": "Logo", - "signature": "Signature", - "formula": "Formula" - } - }, - "reset-password-dialog": { - "header": "Set Temporary Password for {userName}", - "form": { - "password": "Temporary password" - }, - "actions": { - "save": "Save", - "cancel": "Cancel" - } - }, "comment": "Comment", "comments": { "add-comment": "Enter comment", @@ -406,23 +388,11 @@ "warning": "Warning: this cannot be undone!" }, "confirm-delete-users": { - "cancel": { - "bulk": "Keep Users", - "single": "Keep User" - }, - "delete": { - "bulk": "Delete Users", - "single": "Delete User" - }, - "impacted-documents": { - "bulk": "All documents pending review from the users will be impacted", - "single": "All documents pending review from the user will be impacted" - }, - "impacted-dossiers": "{dossiersCount} dossiers will be impacted", - "title": { - "bulk": "Delete Users from Workspace", - "single": "Delete User from Workspace" - }, + "cancel": "Keep {userCount, plural, =0{} one{User} other{Users}}", + "delete": "Delete {userCount, plural, =0{} one{User} other{Users}}", + "impacted-documents": "All documents pending review from the {userCount, plural, =0{} one{user} other{users}} will be impacted", + "impacted-dossiers": "{dossiersCount} {dossiersCount, plural, =0{dossiers} one{dossier} other{dossiers}} will be impacted", + "title": "Delete {userCount, plural, =0{} one{User} other{Users}} from Workspace", "toast-error": "Please confirm that you understand the ramifications of your action!", "warning": "Warning: this cannot be undone!" }, @@ -577,6 +547,39 @@ "save": "Save Document Info", "title": "Introduce File Attributes" }, + "dossier-attribute-types": { + "DATE": "Date", + "NUMBER": "Number", + "TEXT": "Free Text", + "IMAGE": "Image" + }, + "dossier-attributes": "Dossier Attributes", + "dossier-attributes-listing": { + "action": { + "delete": "Delete Attribute", + "edit": "Edit Attribute" + }, + "add-new": "New Attribute", + "bulk": { + "delete": "Delete Selected Attributes" + }, + "no-match": { + "title": "No attributes match your current filters." + }, + "no-data": { + "action": "New Attribute", + "title": "There are no dossier attributes." + }, + "search": "Search...", + "table-col-names": { + "label": "Label", + "placeholder": "Placeholder", + "type": "Type" + }, + "table-header": { + "title": "{length} dossier attributes" + } + }, "dossier-details": { "assign-members": "Assign Members", "collapse": "Hide Details", @@ -850,19 +853,11 @@ "unsaved-changes": "You have unsaved changes. Save or revert before changing the tab." }, "efsa": "EFSA Approval", - "ERROR": "Re-processing required", - "EXCLUDED": "Excluded", "file-attribute-types": { "DATE": "Date", "NUMBER": "Number", "TEXT": "Free Text" }, - "dossier-attribute-types": { - "DATE": "Date", - "NUMBER": "Number", - "TEXT": "Free Text", - "IMAGE": "Image" - }, "file-attributes": "File Attributes", "file-attributes-csv-import": { "action": { @@ -950,33 +945,6 @@ }, "upload-csv": "Upload File Attributes Configuration" }, - "dossier-attributes": "Dossier Attributes", - "dossier-attributes-listing": { - "action": { - "delete": "Delete Attribute", - "edit": "Edit Attribute" - }, - "add-new": "New Attribute", - "bulk": { - "delete": "Delete Selected Attributes" - }, - "no-match": { - "title": "No attributes match your current filters." - }, - "no-data": { - "action": "New Attribute", - "title": "There are no dossier attributes." - }, - "search": "Search...", - "table-col-names": { - "label": "Label", - "placeholder": "Placeholder", - "type": "Type" - }, - "table-header": { - "title": "{length} dossier attributes" - } - }, "file-preview": { "assign-me": "Assign to me", "assign-reviewer": "Assign Reviewer", @@ -1071,7 +1039,6 @@ "status": "Status" }, "finished": "Finished", - "FULLREPROCESS": "Processing", "hint": "Hint", "initials-avatar": { "unassigned": "Unassigned", @@ -1148,7 +1115,6 @@ "tomorrow": "Tomorrow", "yesterday": "Yesterday" }, - "OCR_PROCESSING": "OCR Processing", "overwrite-files-dialog": { "options": { "cancel": "Cancel all uploads", @@ -1173,8 +1139,25 @@ }, "pending-analysis": "Pending Re-Analysis", "pending-changes-guard": "WARNING: You have unsaved changes. Press Cancel to go back and save these changes, or OK to lose these changes.", - "PROCESSING": "Processing", "readonly": "Read only", + "recategorize-image-dialog": { + "actions": { + "cancel": "Cancel", + "save": "Save Changes" + }, + "content": { + "comment": "Comment", + "type": "Select image type", + "type-placeholder": "Select a type..." + }, + "header": "Edit Image Type", + "options": { + "image": "Image", + "logo": "Logo", + "signature": "Signature", + "formula": "Formula" + } + }, "redaction": "Redaction", "remove-annotations-dialog": { "confirm": "Yes, proceed and remove!", @@ -1207,8 +1190,17 @@ "title": "Reports", "upload-document": "Upload a Document" }, - "REPROCESS": "Processing", "reset-filters": "Reset Filters", + "reset-password-dialog": { + "header": "Set Temporary Password for {userName}", + "form": { + "password": "Temporary password" + }, + "actions": { + "save": "Save", + "cancel": "Cancel" + } + }, "roles": { "INACTIVE": "Inactive", "MANAGER_ADMIN": "Manager & Admin", @@ -1284,6 +1276,39 @@ }, "title": "Configure SMTP Account" }, + "sorting": { + "alphabetically": "Alphabetically", + "custom": "Custom", + "number-of-analyses": "Number of analyses", + "number-of-pages": "Number of pages", + "oldest": "Oldest", + "recent": "Recent" + }, + "submitted": "Submitted", + "suggestion": "Suggestion for redaction", + "time": { + "no-time-left": "Time to restore already passed", + "less-than-an-hour": "< 1 hour", + "hour": "hour", + "hours": "hours", + "day": "day", + "days": "days" + }, + "top-bar": { + "navigation-items": { + "back": "Back", + "dossiers": "Active Dossier", + "my-account": { + "children": { + "admin": "Settings", + "downloads": "My Downloads", + "my-profile": "My Profile", + "trash": "Trash", + "logout": "Logout" + } + } + } + }, "trash": { "label": "Trash", "table-header": { @@ -1312,36 +1337,7 @@ "title": "No dossiers match your current filters." } }, - "sorting": { - "alphabetically": "Alphabetically", - "custom": "Custom", - "number-of-analyses": "Number of analyses", - "number-of-pages": "Number of pages", - "oldest": "Oldest", - "recent": "Recent" - }, - "submitted": "Submitted", - "suggestion": "Suggestion for redaction", - "top-bar": { - "navigation-items": { - "back": "Back", - "dossiers": "Active Dossier", - "my-account": { - "children": { - "admin": "Settings", - "downloads": "My Downloads", - "my-profile": "My Profile", - "trash": "Trash", - "logout": "Logout" - } - } - } - }, "type": "Type", - "UNASSIGNED": "Unassigned", - "UNDER_APPROVAL": "Under Approval", - "UNDER_REVIEW": "Under Review", - "UNPROCESSED": "Unprocessed", "upload-status": { "dialog": { "actions": { @@ -1418,13 +1414,5 @@ "text-placeholder": "Enter text" }, "title": "Watermark" - }, - "time": { - "no-time-left": "Time to restore already passed", - "less-than-an-hour": "< 1 hour", - "hour": "hour", - "hours": "hours", - "day": "day", - "days": "days" } } From 1f5b567070ac922c9b061c00906e7c572ca6b8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 19 Jul 2021 21:33:19 +0300 Subject: [PATCH 08/25] Translation rework: Default colors --- .../src/app/models/default-color-key.model.ts | 10 + .../edit-color-dialog.component.ts | 5 +- .../default-colors-screen.component.ts | 3 +- .../default-color-translations.ts | 16 ++ apps/red-ui/src/assets/i18n/te.json | 218 ++++++++++++++++-- 5 files changed, 234 insertions(+), 18 deletions(-) create mode 100644 apps/red-ui/src/app/models/default-color-key.model.ts create mode 100644 apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts diff --git a/apps/red-ui/src/app/models/default-color-key.model.ts b/apps/red-ui/src/app/models/default-color-key.model.ts new file mode 100644 index 000000000..086eade16 --- /dev/null +++ b/apps/red-ui/src/app/models/default-color-key.model.ts @@ -0,0 +1,10 @@ +export type DefaultColorType = + | 'analysisColor' + | 'defaultColor' + | 'dictionaryRequestColor' + | 'manualRedactionColor' + | 'notRedacted' + | 'previewColor' + | 'requestAdd' + | 'requestRemove' + | 'updatedColor'; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index 37ce4623e..67df7c56d 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -4,6 +4,7 @@ import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; import { NotificationService, NotificationType } from '@services/notification.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; +import { DefaultColorType } from '@models/default-color-key.model'; @Component({ selector: 'redaction-edit-color-dialog', @@ -12,7 +13,7 @@ import { TranslateService } from '@ngx-translate/core'; }) export class EditColorDialogComponent { readonly colors: Colors; - readonly colorKey: string; + readonly colorKey: DefaultColorType; colorForm: FormGroup; private readonly _initialColor: string; private readonly _dossierTemplateId: string; @@ -24,7 +25,7 @@ export class EditColorDialogComponent { private readonly _translateService: TranslateService, private readonly _dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) - private readonly _data: { colors: Colors; colorKey: string; dossierTemplateId: string } + private readonly _data: { colors: Colors; colorKey: DefaultColorType; dossierTemplateId: string } ) { this.colors = _data.colors; this.colorKey = _data.colorKey; 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 cc63d6124..eb2ba49ce 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 @@ -10,6 +10,7 @@ import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { ScreenNames, SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; +import { DefaultColorType } from '@models/default-color-key.model'; @Component({ templateUrl: './default-colors-screen.component.html', @@ -43,7 +44,7 @@ export class DefaultColorsScreenComponent await this._loadColors(); } - openEditColorDialog($event: any, color: { key: string; value: string }) { + openEditColorDialog($event: any, color: { key: DefaultColorType; value: string }) { this._dialogService.openDialog( 'editColor', $event, diff --git a/apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts b/apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts new file mode 100644 index 000000000..fe4b1b65c --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts @@ -0,0 +1,16 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { DefaultColorType } from '@models/default-color-key.model'; + +const translations: { [key in DefaultColorType]: string } = { + analysisColor: _('default-colors-screen.types.analysisColor'), + defaultColor: _('default-colors-screen.types.defaultColor'), + dictionaryRequestColor: _('default-colors-screen.types.dictionaryRequestColor'), + manualRedactionColor: _('default-colors-screen.types.manualRedactionColor'), + notRedacted: _('default-colors-screen.types.notRedacted'), + previewColor: _('default-colors-screen.types.previewColor'), + requestAdd: _('default-colors-screen.types.requestAdd'), + requestRemove: _('default-colors-screen.types.requestRemove'), + updatedColor: _('default-colors-screen.types.updatedColor') +}; + +export default translations; diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 987fe13a8..a1f76881c 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -13,7 +13,8 @@ }, "add-dossier-dialog": { "actions": { - "save": "" + "save": "", + "save-and-add-members": "" }, "errors": { "dossier-already-exists": "", @@ -99,6 +100,7 @@ "add-edit-user": { "actions": { "cancel": "", + "delete": "", "save": "", "save-changes": "" }, @@ -122,6 +124,9 @@ "accept-suggestion": { "label": "" }, + "edit-reason": { + "label": "" + }, "force-redaction": { "label": "" }, @@ -133,6 +138,7 @@ "only-here": "", "remove-from-dict": "" }, + "show": "", "undo": "" }, "annotations": "", @@ -144,9 +150,14 @@ "no-approvers": "", "no-reviewers": "", "reviewers": "", + "search": "", "single-user": "" } }, + "assign-user": { + "cancel": "", + "save": "" + }, "audit": "", "audit-screen": { "categories": { @@ -188,8 +199,18 @@ "header": "" }, "comments": { + "add-comment": "", "hide-comments": "" }, + "common": { + "close": "", + "confirmation-dialog": { + "confirm": "", + "deny": "", + "description": "", + "title": "" + } + }, "configurations": "", "confirm-delete-file-attribute": { "cancel": { @@ -199,17 +220,39 @@ "warning": "" }, "confirm-delete-users": { - "cancel": { - "": "" - }, - "title": { - "": "" - }, + "cancel": "", + "delete": "", + "impacted-documents": "", + "impacted-dossiers": "", + "title": "", "toast-error": "", "warning": "" }, + "confirmation-dialog": { + "assign-file-to-me": { + "question": "", + "title": "" + }, + "compare-file": { + "question": "", + "title": "" + }, + "delete-dossier": { + "confirmation-text": "", + "deny-text": "", + "question": "", + "title": "" + }, + "delete-file": { + "question": "", + "title": "" + } + }, "content": "", "default-colors-screen": { + "action": { + "edit": "" + }, "table-col-names": { "color": "", "key": "" @@ -218,11 +261,28 @@ "title": "" }, "types": { - "": "" + "": "", + "analysisColor": "", + "defaultColor": "", + "dictionaryRequestColor": "", + "manualRedactionColor": "", + "notRedacted": "", + "previewColor": "", + "requestAdd": "", + "requestRemove": "", + "updatedColor": "" } }, "dev-mode": "", "dictionary-listing": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk": { + "delete": "" + }, "case-sensitive": "", "no-data": { "action": "", @@ -231,6 +291,7 @@ "no-match": { "title": "" }, + "search": "", "stats": { "charts": { "entries": "" @@ -246,6 +307,12 @@ } }, "dictionary-overview": { + "action": { + "delete": "", + "download": "", + "edit": "", + "upload": "" + }, "compare": { "compare": "" }, @@ -257,6 +324,7 @@ "generic": "" }, "revert-changes": "", + "save-changes": "", "search": "", "select-dictionary": "", "success": { @@ -267,9 +335,11 @@ "digital-signature-screen": { "action": { "certificate-not-valid-error": "", + "delete": "", "delete-error": "", "delete-success": "", "reset": "", + "save": "", "save-error": "", "save-success": "" }, @@ -303,6 +373,13 @@ "title": "" }, "dossier-attributes-listing": { + "action": { + "edit": "" + }, + "add-new": "", + "bulk": { + "delete": "" + }, "no-data": { "action": "", "title": "" @@ -310,6 +387,7 @@ "no-match": { "title": "" }, + "search": "", "table-col-names": { "label": "", "type": "" @@ -319,6 +397,8 @@ } }, "dossier-details": { + "assign-members": "", + "edit-owner": "", "members": "", "owner": "", "see-less": "", @@ -331,6 +411,12 @@ }, "dossier-listing": { "add-new": "", + "delete": { + "action": "" + }, + "edit": { + "action": "" + }, "no-data": { "action": "", "title": "" @@ -344,6 +430,9 @@ "to-approve": "", "to-review": "" }, + "reanalyse": { + "action": "" + }, "search": "", "stats": { "analyzed-pages": "", @@ -360,6 +449,18 @@ } }, "dossier-overview": { + "approve": "", + "approve-disabled": "", + "assign-approver": "", + "assign-me": "", + "assign-reviewer": "", + "bulk": { + "delete": "", + "reanalyse": "" + }, + "delete": { + "action": "" + }, "dossier-details": { "attributes": { "expand": "", @@ -376,6 +477,8 @@ "people": "" } }, + "download-file": "", + "download-file-disabled": "", "file-listing": { "file-entry": { "file-error": "", @@ -401,6 +504,7 @@ "no-match": { "title": "" }, + "ocr-file": "", "ocr-performed": "", "quick-filters": { "assigned-to-me": "", @@ -412,6 +516,9 @@ "error": "", "success": "" }, + "reanalyse": { + "action": "" + }, "search": "", "table-col-names": { "added-on": "", @@ -424,10 +531,20 @@ "table-header": { "title": "" }, + "under-approval": "", + "under-review": "", "upload-files": "" }, "dossier-templates": "", "dossier-templates-listing": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk": { + "delete": "" + }, "dictionaries": "", "no-data": { "title": "" @@ -435,6 +552,7 @@ "no-match": { "title": "" }, + "search": "", "table-col-names": { "created-by": "", "created-on": "", @@ -458,6 +576,10 @@ "label": "" }, "downloads-list": { + "actions": { + "delete": "", + "download": "" + }, "no-data": { "title": "" }, @@ -487,7 +609,9 @@ }, "attributes": { "custom-attributes": "", - "image-attributes": "" + "delete-image": "", + "image-attributes": "", + "upload-image": "" }, "change-successful": "", "delete-successful": "", @@ -511,7 +635,14 @@ }, "header": "", "nav-items": { - "": "" + "choose-download": "", + "dossier-attributes": "", + "dossier-dictionary": "", + "dossier-info": "", + "download-package": "", + "general-info": "", + "members": "", + "team-members": "" }, "unsaved-changes": "" }, @@ -519,6 +650,12 @@ "": "" }, "file-attributes-csv-import": { + "action": { + "cancel-edit-name": "", + "edit-name": "", + "remove": "", + "save-name": "" + }, "available": "", "cancel": "", "delimiter": "", @@ -533,6 +670,7 @@ }, "no-hovered-column": "", "no-sample-data-for": "", + "parse-csv": "", "quick-activation": { "all": "", "none": "" @@ -542,6 +680,9 @@ "label": "", "success": "" }, + "search": { + "placeholder": "" + }, "selected": "", "table-col-names": { "name": "", @@ -553,7 +694,9 @@ "table-header": { "actions": { "disable-read-only": "", - "enable-read-only": "" + "enable-read-only": "", + "read-only": "", + "remove-selected": "" }, "title": "" }, @@ -561,6 +704,14 @@ "total-rows": "" }, "file-attributes-listing": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk-actions": { + "delete": "" + }, "no-data": { "title": "" }, @@ -568,6 +719,7 @@ "title": "" }, "read-only": "", + "search": "", "table-col-names": { "csv-column": "", "name": "", @@ -578,13 +730,20 @@ }, "table-header": { "title": "" - } + }, + "upload-csv": "" }, "file-preview": { + "assign-me": "", "assign-reviewer": "", + "change-reviewer": "", "delta": "", "delta-tooltip": "", + "document-info": "", + "download-original-file": "", + "exclude-pages": "", "excluded-from-redaction": "", + "fullscreen": "", "last-reviewer": "", "no-data": { "title": "" @@ -593,12 +752,15 @@ "jump-first": "", "jump-last": "" }, + "reanalyse-notification": "", "redacted": "", "redacted-tooltip": "", "standard": "", "standard-tooltip": "", "tabs": { "annotations": { + "jump-to-next": "", + "jump-to-previous": "", "label": "", "page-is": "", "select": "", @@ -606,18 +768,24 @@ "select-none": "" }, "document-info": { + "close": "", "details": { "created-on": "", "dossier": "", "due": "", "pages": "" }, + "edit": "", "label": "" }, "exclude-pages": { + "close": "", "error": "", + "hint": "", + "input-placeholder": "", "label": "", "no-excluded": "", + "put-back": "", "removed-from-redaction": "" } } @@ -704,7 +872,8 @@ "options": { "cancel": "", "overwrite": "", - "remember": "" + "remember": "", + "skip": "" }, "question": "", "title": "" @@ -781,6 +950,7 @@ "generic": "" }, "revert-changes": "", + "save-changes": "", "success": { "generic": "" } @@ -799,7 +969,8 @@ }, "smtp-config-screen": { "actions": { - "save": "" + "save": "", + "test-connection": "" }, "form": { "auth": "", @@ -878,6 +1049,10 @@ }, "upload-status": { "dialog": { + "actions": { + "cancel": "", + "re-upload": "" + }, "title": "" }, "error": { @@ -886,9 +1061,19 @@ } }, "user-listing": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk": { + "delete": "", + "delete-disabled": "" + }, "no-match": { "title": "" }, + "search": "", "table-col-names": { "active": "", "email": "", @@ -913,6 +1098,8 @@ "title": "" }, "user-stats": { + "collapse": "", + "expand": "", "title": "" }, "watermark-screen": { @@ -920,7 +1107,8 @@ "change-success": "", "delete-success": "", "error": "", - "revert": "" + "revert": "", + "save": "" }, "form": { "color": "", From 0b6ee28b720a07845a362dbc06ac3e1840ddfbd1 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 20 Jul 2021 02:36:52 +0300 Subject: [PATCH 09/25] code cleanup --- ...confirm-delete-users-dialog.component.html | 9 ++- ...-attributes-csv-import-dialog.component.ts | 3 +- .../default-colors-screen.component.ts | 2 +- ...er-templates-listing-screen.component.html | 2 +- .../license-information-screen.component.html | 2 +- .../screens/rules/rules-screen.component.ts | 8 +- .../screens/trash/trash-screen.component.ts | 2 +- .../user-listing-screen.component.ts | 3 +- .../annotation-actions.component.html | 39 +++------ .../annotation-actions.component.ts | 6 +- .../page-exclusion.component.ts | 1 - .../pdf-viewer/pdf-viewer.component.scss | 2 + .../edit-dossier-dialog.component.ts | 4 +- .../dossier-listing-screen.component.html | 2 +- .../dossier-listing-screen.component.ts | 28 +++---- .../dossier-overview-screen.component.ts | 2 +- .../shared/base/base-listing.component.ts | 30 +++---- .../dictionary-manager.component.ts | 19 ++--- .../page-header/page-header.component.html | 4 +- .../table-header/table-header.component.html | 6 +- .../modules/shared/services/filter.service.ts | 23 +++--- .../shared/services/screen-state.service.ts | 81 +++++++++---------- .../modules/shared/services/search.service.ts | 12 ++- .../src/app/services/sorting.service.ts | 24 +++--- .../app/services/user-preference.service.ts | 4 +- .../general/pdftron-action-close-compare.svg | 6 +- .../icons/general/pdftron-action-compare.svg | 4 +- .../src/assets/icons/general/put-back.svg | 8 +- .../src/assets/icons/general/reason.svg | 15 +++- .../src/assets/styles/red-controls.scss | 5 +- 30 files changed, 176 insertions(+), 180 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html index 0d0eb7328..14f0eda1e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html @@ -17,7 +17,14 @@ [class.error]="!checkbox.value && showToast" color="primary" > - {{ checkbox.label | translate: { dossiersCount: dossiersCount, userCount: users.length } }} + {{ + checkbox.label + | translate + : { + dossiersCount: dossiersCount, + userCount: users.length + } + }}
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 44cac87d1..763c1f7ae 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 @@ -31,8 +31,6 @@ export interface Field { providers: [FilterService, SearchService, ScreenStateService, SortingService] }) export class FileAttributesCsvImportDialogComponent extends BaseListingComponent { - protected readonly _primaryKey = 'id'; - csvFile: File; dossierTemplateId: string; parseResult: { data: any[]; errors: any[]; meta: any; fields: Field[] }; @@ -45,6 +43,7 @@ export class FileAttributesCsvImportDialogComponent extends BaseListingComponent keepPreview = false; columnSample = []; initialParseConfig: { delimiter?: string; encoding?: string } = {}; + protected readonly _primaryKey = 'id'; constructor( private readonly _appStateService: AppStateService, 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 a76513de9..420a785a2 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 @@ -25,8 +25,8 @@ export class DefaultColorsScreenComponent }> implements OnInit { - private _colorsObj: Colors; protected readonly _primaryKey = 'key'; + private _colorsObj: Colors; constructor( private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html index 06e453cb1..f5394e270 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-template-listing/dossier-templates-listing-screen.component.html @@ -30,8 +30,8 @@ diff --git a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html index 654cc2576..187ba165a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html @@ -5,9 +5,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 d8a6552a7..3558d2330 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 @@ -47,10 +47,6 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit _appStateService.activateDossierTemplate(_activatedRoute.snapshot.params.dossierTemplateId); } - async ngOnInit() { - await this._initialize(); - } - get hasChanges(): boolean { return this.currentLines.toString() !== this.initialLines.toString(); } @@ -64,6 +60,10 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit this.codeEditorTextChanged(); } + async ngOnInit() { + await this._initialize(); + } + onCodeEditorInit(editor: ICodeEditor) { this._codeEditor = editor; (window as any).monaco.editor.defineTheme('redaction', { diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts index 8c362ec5d..f3f7572b7 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts @@ -20,8 +20,8 @@ import { DossiersService } from '../../../dossier/services/dossiers.service'; }) export class TrashScreenComponent extends BaseListingComponent implements OnInit { readonly itemSize = 85; - private readonly _deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.DELETE_RETENTION_HOURS); protected readonly _primaryKey = 'dossierName'; + private readonly _deleteRetentionHours = this._appConfigService.getConfig(AppConfigKey.DELETE_RETENTION_HOURS); constructor( private readonly _appStateService: AppStateService, 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 4a6fdd703..935c29cf4 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 @@ -22,11 +22,10 @@ import { map } from 'rxjs/operators'; providers: [FilterService, SearchService, ScreenStateService, SortingService] }) export class UserListingScreenComponent extends BaseListingComponent implements OnInit { - protected readonly _primaryKey = 'userId'; readonly canDeleteSelected$ = this._canDeleteSelected$; - collapsedDetails = false; chartData: DoughnutChartConfig[] = []; + protected readonly _primaryKey = 'userId'; @ViewChildren(InitialsAvatarComponent) private readonly _avatars: QueryList; diff --git a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html index 5361a4aed..145bcc4bc 100644 --- a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.html @@ -6,8 +6,7 @@ [tooltip]="'annotation-actions.edit-reason.label' | translate" [type]="btnType" icon="red:edit" - > - + > - + > - + > - + > - + > - + > - + > - + > - + > - + > - + > - + > - + >
diff --git a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.ts index 790c99fbe..70425a94a 100644 --- a/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/annotation-actions/annotation-actions.component.ts @@ -14,14 +14,10 @@ import { WebViewerInstance } from '@pdftron/webviewer'; export class AnnotationActionsComponent implements OnInit { @Input() btnType: 'dark-bg' | 'primary' = 'dark-bg'; @Input() tooltipPosition: 'before' | 'above' = 'before'; - - @Input() _annotations: AnnotationWrapper[]; @Input() canPerformAnnotationActions: boolean; @Input() viewer: WebViewerInstance; @Input() alwaysVisible: boolean; - @Output() annotationsChanged = new EventEmitter(); - annotationPermissions: AnnotationPermissions; constructor( @@ -30,6 +26,8 @@ export class AnnotationActionsComponent implements OnInit { private _permissionsService: PermissionsService ) {} + private _annotations: AnnotationWrapper[]; + get annotations(): AnnotationWrapper[] { return this._annotations; } diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index 0dd8eb2bb..1555cef37 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -5,7 +5,6 @@ import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; import { FileDataModel } from '../../../../models/file/file-data.model'; import { Toaster } from '../../../../services/toaster.service'; import { LoadingService } from '../../../../services/loading.service'; -import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'redaction-page-exclusion', diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.scss b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.scss index a4ca9fb65..9c85a3acf 100644 --- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.scss +++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.scss @@ -49,11 +49,13 @@ .page-number-input { -moz-appearance: textfield; + &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } + color: $grey-7; text-decoration: none; outline: none; 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 3a2624f57..869f3c9a2 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 @@ -1,7 +1,5 @@ import { ChangeDetectorRef, Component, Inject, ViewChild } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { FormBuilder } from '@angular/forms'; -import { AppStateService } from '@state/app-state.service'; +import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierGeneralInfoComponent } from './general-info/edit-dossier-general-info.component'; import { EditDossierDownloadPackageComponent } from './download-package/edit-dossier-download-package.component'; 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 e65ce9f1a..0a2b67ad8 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 @@ -9,8 +9,8 @@
p.dossier.status === Dossier.StatusEnum.ACTIVE).length; + } + + private get _inactiveDossiersCount(): number { + return this.screenStateService.allEntities.length - this._activeDossiersCount; + } + ngOnInit(): void { this.calculateData(); @@ -144,18 +154,6 @@ export class DossierListingScreenComponent }); } - private get _userId() { - return this._userService.userId; - } - - private get _activeDossiersCount(): number { - return this.screenStateService.allEntities.filter(p => p.dossier.status === Dossier.StatusEnum.ACTIVE).length; - } - - private get _inactiveDossiersCount(): number { - return this.screenStateService.allEntities.length - this._activeDossiersCount; - } - calculateData() { this._computeAllFilters(); 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 9bab99401..e41bfde75 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 @@ -43,10 +43,10 @@ export class DossierOverviewScreenComponent implements OnInit, OnDestroy, OnDetach, OnAttach { readonly itemSize = 80; - protected readonly _primaryKey = 'filename'; collapsedDetails = false; actionConfigs: ActionConfig[]; dossierAttributes: DossierAttributeWithValue[] = []; + protected readonly _primaryKey = 'filename'; @ViewChild(DossierDetailsComponent, { static: false }) private readonly _dossierDetailsComponent: DossierDetailsComponent; private readonly _lastOpenedFileKey = 'Dossier-Recent-' + this.activeDossier.dossierId; 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 9a3d2e34c..a396f5cb8 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 @@ -44,6 +44,21 @@ export abstract class BaseListingComponent extends AutoUnsubscribeComponent i this.noMatch$ = this._noMatch$; } + get allEntities(): T[] { + return this.screenStateService.allEntities; + } + + private get _sortedDisplayedEntities$(): Observable { + return this.screenStateService.displayedEntities$.pipe(map(entities => this.sortingService.defaultSort(entities))); + } + + private get _noMatch$(): Observable { + return combineLatest([this.screenStateService.allEntitiesLength$, this.screenStateService.displayedLength$]).pipe( + map(([hasEntities, hasDisplayedEntities]) => hasEntities && !hasDisplayedEntities), + distinctUntilChanged() + ); + } + setInitialConfig() { this.sortingService.setSortingOption({ column: this._primaryKey, @@ -56,21 +71,6 @@ export abstract class BaseListingComponent extends AutoUnsubscribeComponent i super.ngOnDestroy(); } - private get _sortedDisplayedEntities$(): Observable { - return this.screenStateService.displayedEntities$.pipe(map(entities => this.sortingService.defaultSort(entities))); - } - - get allEntities(): T[] { - return this.screenStateService.allEntities; - } - - private get _noMatch$(): Observable { - return combineLatest([this.screenStateService.allEntitiesLength$, this.screenStateService.displayedLength$]).pipe( - map(([hasEntities, hasDisplayedEntities]) => hasEntities && !hasDisplayedEntities), - distinctUntilChanged() - ); - } - canBulkDelete$(hasPermission = true): Observable { return this.screenStateService.areSomeEntitiesSelected$.pipe( map(areSomeEntitiesSelected => areSomeEntitiesSelected && hasPermission), diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index a6d438dcf..6d1b55de0 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -44,7 +44,6 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { private _diffEditor: IDiffEditor; private _decorations: string[] = []; private _searchDecorations: string[] = []; - private _dossier: DossierWrapper = this.selectDossier as DossierWrapper; constructor( private readonly _dictionaryControllerService: DictionaryControllerService, @@ -53,14 +52,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { this.currentEntries = this.initialEntries; } - ngOnInit(): void { - this.editorOptions = { - theme: 'vs', - language: 'text/plain', - automaticLayout: true, - readOnly: !this.canEdit - }; - } + private _dossier: DossierWrapper = this.selectDossier as DossierWrapper; get dossier() { return this._dossier; @@ -101,6 +93,15 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { return this.currentEntries.toString() !== this.initialEntries.toString(); } + ngOnInit(): void { + this.editorOptions = { + theme: 'vs', + language: 'text/plain', + automaticLayout: true, + readOnly: !this.canEdit + }; + } + onDiffEditorInit(editor: IDiffEditor): void { this._diffEditor = editor; } diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index d8eda0bc2..346fb55bc 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -25,7 +25,7 @@
-
+
diff --git a/apps/red-ui/src/app/modules/shared/services/filter.service.ts b/apps/red-ui/src/app/modules/shared/services/filter.service.ts index 692298ae6..357b4b41c 100644 --- a/apps/red-ui/src/app/modules/shared/services/filter.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/filter.service.ts @@ -1,24 +1,29 @@ import { Injectable } from '@angular/core'; import { FilterModel } from '@shared/components/filters/popup-filter/model/filter.model'; -import { getFilteredEntities, processFilters } from '@shared/components/filters/popup-filter/utils/filter-utils'; -import { ScreenStateService } from '@shared/services/screen-state.service'; -import { SearchService } from '@shared/services/search.service'; +import { processFilters } from '@shared/components/filters/popup-filter/utils/filter-utils'; import { FilterGroup } from '@shared/components/filters/popup-filter/model/filter-wrapper.model'; import { BehaviorSubject, Observable } from 'rxjs'; import { distinctUntilChanged, map, switchMap } from 'rxjs/operators'; @Injectable() export class FilterService { + readonly showResetFilters$ = this._showResetFilters$; private readonly _filterGroups$ = new BehaviorSubject([]); private readonly _refresh$ = new BehaviorSubject(null); - readonly filterGroups$ = this._refresh$.pipe(switchMap(() => this._filterGroups$.asObservable())); - readonly showResetFilters$ = this._showResetFilters$; get filterGroups(): FilterGroup[] { return Object.values(this._filterGroups$.getValue()); } + private get _showResetFilters$(): Observable { + return this.filterGroups$.pipe( + map(all => this._toFlatFilters(all)), + map(f => !!f.find(el => el.checked)), + distinctUntilChanged() + ); + } + refresh(): void { this._refresh$.next(null); } @@ -67,14 +72,6 @@ export class FilterService { this.refresh(); } - private get _showResetFilters$(): Observable { - return this.filterGroups$.pipe( - map(all => this._toFlatFilters(all)), - map(f => !!f.find(el => el.checked)), - distinctUntilChanged() - ); - } - private _toFlatFilters(entities: FilterGroup[]): FilterModel[] { const flatChildren = (filters: FilterModel[]) => (filters ?? []).reduce((acc, f) => [...acc, ...(f?.filters ?? [])], []); diff --git a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts index 9ad198c66..5728833dc 100644 --- a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts @@ -9,22 +9,19 @@ const toLengthValue = entities => entities?.length ?? 0; @Injectable() export class ScreenStateService { - private readonly _allEntities$ = new BehaviorSubject([]); - readonly allEntities$ = this._allEntities$.asObservable(); readonly allEntitiesLength$ = this._allEntitiesLength$; - - private readonly _displayedEntities$ = new BehaviorSubject([]); readonly displayedEntities$ = this._getDisplayedEntities$; readonly displayedLength$ = this._displayedLength$; - - private readonly _selectedEntities$ = new BehaviorSubject([]); - readonly selectedEntities$ = this._selectedEntities$.asObservable(); readonly selectedLength$ = this._selectedLength$; - readonly noData$ = this._noData$; readonly areAllEntitiesSelected$ = this._areAllEntitiesSelected$; readonly areSomeEntitiesSelected$ = this._areSomeEntitiesSelected$; readonly notAllEntitiesSelected$ = this._notAllEntitiesSelected$; + private readonly _allEntities$ = new BehaviorSubject([]); + readonly allEntities$ = this._allEntities$.asObservable(); + private readonly _displayedEntities$ = new BehaviorSubject([]); + private readonly _selectedEntities$ = new BehaviorSubject([]); + readonly selectedEntities$ = this._selectedEntities$.asObservable(); constructor(private readonly _filterService: FilterService, private readonly _searchService: SearchService) { // setInterval(() => { @@ -46,36 +43,6 @@ export class ScreenStateService { return Object.values(this._displayedEntities$.getValue()); } - setEntities(newEntities: Partial): void { - this._allEntities$.next(newEntities); - } - - setSelectedEntities(newEntities: Partial): void { - this._selectedEntities$.next(newEntities); - } - - isSelected(entity: T): boolean { - return this.selectedEntities.indexOf(entity) !== -1; - } - - selectEntities(entities?: T[]): void { - if (entities !== undefined && entities !== null && entities.length > 0) { - return entities.forEach(entity => this._selectOne(entity)); - } - return this._selectAll(); - } - - updateSelection(): void { - const items = this.displayedEntities.filter(item => this.selectedEntities.includes(item)); - this.setSelectedEntities(items); - } - - logCurrentState(): void { - console.log('Entities', this.allEntities); - console.log('Displayed', this.displayedEntities); - console.log('Selected', this.selectedEntities); - } - get _getDisplayedEntities$(): Observable { const filterGroups$ = this._filterService.filterGroups$; const searchValue$ = this._searchService.valueChanges$; @@ -133,6 +100,40 @@ export class ScreenStateService { ); } + private get _allEntitiesSelected() { + return this.displayedEntities.length !== 0 && this.displayedEntities.length === this.selectedEntities.length; + } + + setEntities(newEntities: Partial): void { + this._allEntities$.next(newEntities); + } + + setSelectedEntities(newEntities: Partial): void { + this._selectedEntities$.next(newEntities); + } + + isSelected(entity: T): boolean { + return this.selectedEntities.indexOf(entity) !== -1; + } + + selectEntities(entities?: T[]): void { + if (entities !== undefined && entities !== null && entities.length > 0) { + return entities.forEach(entity => this._selectOne(entity)); + } + return this._selectAll(); + } + + updateSelection(): void { + const items = this.displayedEntities.filter(item => this.selectedEntities.includes(item)); + this.setSelectedEntities(items); + } + + logCurrentState(): void { + console.log('Entities', this.allEntities); + console.log('Displayed', this.displayedEntities); + console.log('Selected', this.selectedEntities); + } + private _selectOne(entity: T): void { const currentEntityIdx = this.selectedEntities.indexOf(entity); if (currentEntityIdx === -1) { @@ -145,8 +146,4 @@ export class ScreenStateService { if (this._allEntitiesSelected) return this.setSelectedEntities([]); this.setSelectedEntities(this.displayedEntities); } - - private get _allEntitiesSelected() { - return this.displayedEntities.length !== 0 && this.displayedEntities.length === this.selectedEntities.length; - } } diff --git a/apps/red-ui/src/app/modules/shared/services/search.service.ts b/apps/red-ui/src/app/modules/shared/services/search.service.ts index 93a4453e9..680229212 100644 --- a/apps/red-ui/src/app/modules/shared/services/search.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/search.service.ts @@ -4,16 +4,18 @@ import { startWith } from 'rxjs/operators'; @Injectable() export class SearchService { - private _searchKey: string; - readonly searchForm = this._formBuilder.group({ query: [''] }); - readonly valueChanges$ = this.searchForm.get('query').valueChanges.pipe(startWith('')); + private _searchKey: string; constructor(private readonly _formBuilder: FormBuilder) {} + get searchValue(): string { + return this.searchForm.get('query').value; + } + searchIn(entities: T[]) { if (!this._searchKey) return entities; @@ -25,10 +27,6 @@ export class SearchService { this._searchKey = value; } - get searchValue(): string { - return this.searchForm.get('query').value; - } - reset(): void { this.searchForm.reset({ query: '' }); } diff --git a/apps/red-ui/src/app/services/sorting.service.ts b/apps/red-ui/src/app/services/sorting.service.ts index c6f620aeb..0894e2776 100644 --- a/apps/red-ui/src/app/services/sorting.service.ts +++ b/apps/red-ui/src/app/services/sorting.service.ts @@ -17,6 +17,18 @@ export interface SortingOption { export class SortingService { private _sortingOption: SortingOption; + get sortingOption(): SortingOption { + return this._sortingOption; + } + + private get _currentOrder(): SortingOrder { + return this._sortingOption.order; + } + + private set _currentOrder(value: SortingOrder) { + this._sortingOption.order = value; + } + setSortingOption(value: SortingOption): void { this._sortingOption = value; } @@ -49,16 +61,4 @@ export class SortingService { this._sortingOption = { column, order: SortingOrders.ASC }; } } - - get sortingOption(): SortingOption { - return this._sortingOption; - } - - private get _currentOrder(): SortingOrder { - return this._sortingOption.order; - } - - private set _currentOrder(value: SortingOrder) { - this._sortingOption.order = value; - } } diff --git a/apps/red-ui/src/app/services/user-preference.service.ts b/apps/red-ui/src/app/services/user-preference.service.ts index e2999f0ce..f788146b5 100644 --- a/apps/red-ui/src/app/services/user-preference.service.ts +++ b/apps/red-ui/src/app/services/user-preference.service.ts @@ -9,14 +9,14 @@ interface UserAttributes { providedIn: 'root' }) export class UserPreferenceService { - private _userAttributes: UserAttributes = {}; - constructor(private readonly _userPreferenceControllerService: UserPreferenceControllerService) { _userPreferenceControllerService.getAllUserAttributes().subscribe(attributes => { this._userAttributes = attributes ?? {}; }); } + private _userAttributes: UserAttributes = {}; + get userAttributes(): UserAttributes { return this._userAttributes; } diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-close-compare.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-close-compare.svg index df53361e4..82ddb11d8 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-close-compare.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-close-compare.svg @@ -1,11 +1,13 @@ - + - + diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-compare.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-compare.svg index a7c3e888e..6765155b5 100644 --- a/apps/red-ui/src/assets/icons/general/pdftron-action-compare.svg +++ b/apps/red-ui/src/assets/icons/general/pdftron-action-compare.svg @@ -1,7 +1,7 @@ - + - 711C9D82-CAA8-47BE-954A-A9DA22CE85E6 - + - + diff --git a/apps/red-ui/src/assets/icons/general/reason.svg b/apps/red-ui/src/assets/icons/general/reason.svg index 2c3bfed3f..f08160e93 100644 --- a/apps/red-ui/src/assets/icons/general/reason.svg +++ b/apps/red-ui/src/assets/icons/general/reason.svg @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/apps/red-ui/src/assets/styles/red-controls.scss b/apps/red-ui/src/assets/styles/red-controls.scss index 339ec9625..919a592f1 100644 --- a/apps/red-ui/src/assets/styles/red-controls.scss +++ b/apps/red-ui/src/assets/styles/red-controls.scss @@ -43,6 +43,7 @@ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Old versions of Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; /* Non-prefixed version, currently - supported by Chrome, Edge, Opera and Firefox */ + user-select: none; + /* Non-prefixed version, currently + supported by Chrome, Edge, Opera and Firefox */ } From 52f82d9430889e2325d9811f6df4efa60eb1dc4f Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 20 Jul 2021 02:41:30 +0300 Subject: [PATCH 10/25] fix reordered code --- .../app/modules/shared/services/filter.service.ts | 2 +- .../modules/shared/services/screen-state.service.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/modules/shared/services/filter.service.ts b/apps/red-ui/src/app/modules/shared/services/filter.service.ts index 357b4b41c..73fd37adc 100644 --- a/apps/red-ui/src/app/modules/shared/services/filter.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/filter.service.ts @@ -7,10 +7,10 @@ import { distinctUntilChanged, map, switchMap } from 'rxjs/operators'; @Injectable() export class FilterService { - readonly showResetFilters$ = this._showResetFilters$; private readonly _filterGroups$ = new BehaviorSubject([]); private readonly _refresh$ = new BehaviorSubject(null); readonly filterGroups$ = this._refresh$.pipe(switchMap(() => this._filterGroups$.asObservable())); + readonly showResetFilters$ = this._showResetFilters$; get filterGroups(): FilterGroup[] { return Object.values(this._filterGroups$.getValue()); diff --git a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts index 5728833dc..4b0b52585 100644 --- a/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/screen-state.service.ts @@ -9,19 +9,22 @@ const toLengthValue = entities => entities?.length ?? 0; @Injectable() export class ScreenStateService { + private readonly _allEntities$ = new BehaviorSubject([]); + readonly allEntities$ = this._allEntities$.asObservable(); readonly allEntitiesLength$ = this._allEntitiesLength$; + + private readonly _displayedEntities$ = new BehaviorSubject([]); readonly displayedEntities$ = this._getDisplayedEntities$; readonly displayedLength$ = this._displayedLength$; + + private readonly _selectedEntities$ = new BehaviorSubject([]); + readonly selectedEntities$ = this._selectedEntities$.asObservable(); readonly selectedLength$ = this._selectedLength$; + readonly noData$ = this._noData$; readonly areAllEntitiesSelected$ = this._areAllEntitiesSelected$; readonly areSomeEntitiesSelected$ = this._areSomeEntitiesSelected$; readonly notAllEntitiesSelected$ = this._notAllEntitiesSelected$; - private readonly _allEntities$ = new BehaviorSubject([]); - readonly allEntities$ = this._allEntities$.asObservable(); - private readonly _displayedEntities$ = new BehaviorSubject([]); - private readonly _selectedEntities$ = new BehaviorSubject([]); - readonly selectedEntities$ = this._selectedEntities$.asObservable(); constructor(private readonly _filterService: FilterService, private readonly _searchService: SearchService) { // setInterval(() => { From 74a82a4745d290b458299409cd88c87f41a7a93c Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Tue, 20 Jul 2021 02:47:44 +0300 Subject: [PATCH 11/25] fix parameter type --- .../screens/default-colors/default-colors-screen.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 420a785a2..64a35aa14 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 @@ -45,7 +45,7 @@ export class DefaultColorsScreenComponent await this._loadColors(); } - openEditColorDialog($event: any, color: { key: DefaultColorType; value: string }) { + openEditColorDialog($event: any, color: { key: DefaultColorType | string; value: string }) { this._dialogService.openDialog( 'editColor', $event, From 99b66766419471f0014c674a1ea3379c916f3398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 20 Jul 2021 16:55:37 +0300 Subject: [PATCH 12/25] Translation rework: delete file attributes, dossier attributes, audit categories --- ...it-dossier-attribute-dialog.component.html | 2 +- ...edit-dossier-attribute-dialog.component.ts | 8 +- ...elete-file-attribute-dialog.component.html | 20 +++- ...-delete-file-attribute-dialog.component.ts | 7 +- ...confirm-delete-users-dialog.component.html | 8 +- .../edit-color-dialog.component.html | 2 +- .../edit-color-dialog.component.ts | 4 +- ...-attributes-csv-import-dialog.component.ts | 2 +- .../screens/audit/audit-screen.component.html | 4 +- .../screens/audit/audit-screen.component.ts | 8 +- .../default-colors-screen.component.html | 2 +- .../default-colors-screen.component.ts | 4 +- .../dictionary-listing-screen.component.ts | 2 +- .../digital-signature-screen.component.ts | 6 +- ...r-attributes-listing-screen.component.html | 2 +- ...ier-attributes-listing-screen.component.ts | 4 +- ...sier-templates-listing-screen.component.ts | 2 +- ...ile-attributes-listing-screen.component.ts | 2 +- .../license-information-screen.component.ts | 6 +- .../screens/rules/rules-screen.component.ts | 2 +- .../smtp-config-screen.component.ts | 4 +- .../screens/trash/trash-screen.component.ts | 2 +- .../watermark/watermark-screen.component.ts | 2 +- .../audit-categories-translations.ts | 18 ++++ ...ions.ts => default-colors-translations.ts} | 4 +- .../dossier-attribute-types-translations.ts | 11 +++ ...dossier-overview-bulk-actions.component.ts | 6 +- .../dossier-details.component.ts | 4 +- .../page-exclusion.component.ts | 4 +- .../team-members-manager.component.ts | 2 +- ...sign-reviewer-approver-dialog.component.ts | 2 +- .../edit-dossier-dialog.component.ts | 2 +- .../edit-dossier-general-info.component.ts | 2 +- .../force-redaction-dialog.component.ts | 2 +- .../manual-annotation-dialog.component.ts | 2 +- .../dossier-listing-screen.component.ts | 2 +- .../dossier-overview-screen.component.ts | 6 +- .../file-preview-screen.component.ts | 6 +- .../services/manual-annotation.service.ts | 2 +- .../shared/base/base-listing.component.ts | 4 +- .../app/modules/shared/pipes/sort-by.pipe.ts | 2 +- .../services/dictionary-save.service.ts | 2 +- .../red-ui/src/app/state/app-state.service.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 58 +++++------- apps/red-ui/src/assets/i18n/te.json | 93 ++++++------------- 45 files changed, 174 insertions(+), 167 deletions(-) create mode 100644 apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts rename apps/red-ui/src/app/modules/admin/translations/{default-color-translations.ts => default-colors-translations.ts} (86%) create mode 100644 apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html index 8f9d45625..ea0ada166 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html @@ -27,7 +27,7 @@ - {{ 'dossier-attribute-types.' + type | translate }} + {{ translations[type] | translate }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts index 5a27f48ea..b21f61273 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts @@ -3,11 +3,12 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { DossierAttributeConfig, FileAttributeConfig } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { LoadingService } from '../../../../services/loading.service'; +import { LoadingService } from '@services/loading.service'; import { HttpErrorResponse } from '@angular/common/http'; -import { Toaster } from '../../../../services/toaster.service'; -import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; +import { Toaster } from '@services/toaster.service'; +import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; +import dossierAttributeTypesTranslations from '../../translations/dossier-attribute-types-translations'; @Component({ selector: 'redaction-add-edit-dossier-attribute-dialog', @@ -17,6 +18,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribeComponent implements OnDestroy { dossierAttributeForm: FormGroup; dossierAttribute: DossierAttributeConfig; + translations = dossierAttributeTypesTranslations; dossierTemplateId: string; readonly typeOptions = [ DossierAttributeConfig.TypeEnum.TEXT, diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html index 4ace83050..91c3cc26b 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html @@ -1,6 +1,13 @@
- {{ 'confirm-delete-file-attribute.title.' + type | translate: { name: fileAttribute?.label } }} + {{ + 'confirm-delete-file-attribute.title' + | translate + : { + type: type, + name: fileAttribute?.label + } + }}
@@ -19,15 +26,20 @@ [class.error]="!checkbox.value && showToast" color="primary" > - {{ 'confirm-delete-file-attribute.' + checkbox.label | translate }} + {{ checkbox.label | translate: { type: type } }}
-
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts index 19bf85133..bad6ea1d0 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, Inject } from '@angular/core'; import { FileAttributeConfig } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-confirm-delete-file-attribute-dialog', @@ -10,8 +11,8 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; export class ConfirmDeleteFileAttributeDialogComponent { fileAttribute: FileAttributeConfig; checkboxes = [ - { value: false, label: 'impacted-documents.' + this.type }, - { value: false, label: 'lost-details' } + { value: false, label: _('confirm-delete-file-attribute.impacted-documents') }, + { value: false, label: _('confirm-delete-file-attribute.lost-details') } ]; showToast = false; @@ -27,7 +28,7 @@ export class ConfirmDeleteFileAttributeDialogComponent { } get type(): 'bulk' | 'single' { - return !this.fileAttribute ? 'bulk' : 'single'; + return this.fileAttribute ? 'single' : 'bulk'; } deleteFileAttribute() { diff --git a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html index 14f0eda1e..47014fd58 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component.html @@ -1,5 +1,5 @@
-
+
@@ -22,7 +22,7 @@ | translate : { dossiersCount: dossiersCount, - userCount: users.length + usersCount: users.length } }} @@ -30,11 +30,11 @@
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html index 369f6468f..bcfc453fd 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index c56609d0b..25b058ef0 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -1,10 +1,11 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { DefaultColorType } from '@models/default-color-key.model'; +import defaultColorsTranslations from '../../translations/default-colors-translations'; @Component({ selector: 'redaction-edit-color-dialog', @@ -15,6 +16,7 @@ export class EditColorDialogComponent { readonly colors: Colors; readonly colorKey: DefaultColorType; colorForm: FormGroup; + translations = defaultColorsTranslations; private readonly _initialColor: string; private readonly _dossierTemplateId: string; 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 763c1f7ae..f78327a45 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 @@ -6,7 +6,7 @@ import * as Papa from 'papaparse'; import { FileAttributeConfig, FileAttributesConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; import { Observable } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; diff --git a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html index 5f839294a..5a7783652 100644 --- a/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html @@ -35,7 +35,7 @@ - {{ 'audit-screen.categories.' + category | translate }} + {{ translations[category] | translate }} @@ -124,7 +124,7 @@
-
+
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 645c50334..eea6367a4 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 @@ -4,8 +4,9 @@ import { FormBuilder, FormGroup } from '@angular/forms'; import { AuditControllerService, AuditResponse, AuditSearchRequest } from '@redaction/red-ui-http'; import { Moment } from 'moment'; import { applyIntervalConstraints } from '@utils/date-inputs-utils'; -import { LoadingService } from '../../../../services/loading.service'; -import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; +import { LoadingService } from '@services/loading.service'; +import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; +import auditCategoriesTranslations from '../../translations/audit-categories-translations'; const PAGE_SIZE = 50; @@ -15,8 +16,9 @@ const PAGE_SIZE = 50; styleUrls: ['./audit-screen.component.scss'] }) export class AuditScreenComponent extends AutoUnsubscribeComponent implements OnDestroy { - readonly ALL_CATEGORIES = 'all-categories'; + readonly ALL_CATEGORIES = 'allCategories'; readonly ALL_USERS = 'audit-screen.all-users'; + translations = auditCategoriesTranslations; filterForm: FormGroup; categories: string[] = []; diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html index 60375ce9a..31a417548 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html @@ -46,7 +46,7 @@
-
+
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 64a35aa14..6cceafce2 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 @@ -10,7 +10,8 @@ import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { DefaultColorType } from '@models/default-color-key.model'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; +import defaultColorsTranslations from '../../translations/default-colors-translations'; @Component({ templateUrl: './default-colors-screen.component.html', @@ -25,6 +26,7 @@ export class DefaultColorsScreenComponent }> implements OnInit { + translations = defaultColorsTranslations; protected readonly _primaryKey = 'key'; private _colorsObj: Colors; 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 fd1fdd8db..d0cb34314 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 @@ -12,7 +12,7 @@ import { LoadingService } from '@services/loading.service'; import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { AdminDialogService } from '../../services/admin-dialog.service'; 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 0a2777a7a..fa45ccd87 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 @@ -1,11 +1,11 @@ import { Component, OnDestroy } from '@angular/core'; import { DigitalSignature, DigitalSignatureControllerService } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { PermissionsService } from '@services/permissions.service'; import { lastIndexOfEnd } from '@utils/functions'; -import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; -import { LoadingService } from '../../../../services/loading.service'; +import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; +import { LoadingService } from '@services/loading.service'; @Component({ selector: 'redaction-digital-signature-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index df5e1bf6e..c9bd4a764 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -116,7 +116,7 @@
- {{ 'dossier-attribute-types.' + attribute.type | translate }} + {{ translations[attribute.type] | translate }}
diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts index fd9d9f10f..17ebdf541 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts @@ -5,12 +5,13 @@ import { AppStateService } from '@state/app-state.service'; import { ActivatedRoute } from '@angular/router'; import { AdminDialogService } from '../../services/admin-dialog.service'; import { LoadingService } from '@services/loading.service'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { PermissionsService } from '@services/permissions.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; +import dossierAttributeTypesTranslations from '../../translations/dossier-attribute-types-translations'; @Component({ templateUrl: './dossier-attributes-listing-screen.component.html', @@ -18,6 +19,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d providers: [FilterService, SearchService, ScreenStateService, SortingService] }) export class DossierAttributesListingScreenComponent extends BaseListingComponent implements OnInit { + translations = dossierAttributeTypesTranslations; protected readonly _primaryKey = 'label'; constructor( 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 769f22100..588e394e8 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 @@ -10,7 +10,7 @@ import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; @Component({ templateUrl: './dossier-templates-listing-screen.component.html', diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts index c17f588f1..cc6a826ac 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts @@ -8,7 +8,7 @@ import { LoadingService } from '@services/loading.service'; import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; @Component({ 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 398f76664..4b7b7d12d 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 @@ -4,9 +4,9 @@ import { LicenseReport, LicenseReportControllerService } from '@redaction/red-ui import { AppConfigService } from '@app-config/app-config.service'; import * as moment from 'moment'; import { TranslateService } from '@ngx-translate/core'; -import { LoadingService } from '../../../../services/loading.service'; -import { ButtonConfig } from '../../../shared/components/page-header/models/button-config.model'; -import { IconButtonTypes } from '../../../shared/components/buttons/icon-button/icon-button.component'; +import { LoadingService } from '@services/loading.service'; +import { ButtonConfig } from '@shared/components/page-header/models/button-config.model'; +import { IconButtonTypes } from '@shared/components/buttons/icon-button/icon-button.component'; @Component({ selector: 'redaction-license-information-screen', 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 3558d2330..0041c99d9 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 @@ -1,7 +1,7 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; import { RulesControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { saveAs } from 'file-saver'; import { ComponentHasChanges } from '@guards/can-deactivate.guard'; 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 33cef2580..5669469cb 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 @@ -8,8 +8,8 @@ import { SmtpConfigurationControllerService, SMTPConfigurationModel } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; -import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; +import { Toaster } from '@services/toaster.service'; +import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; @Component({ selector: 'redaction-smtp-config-screen', diff --git a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts index f3f7572b7..562efdc83 100644 --- a/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/trash/trash-screen.component.ts @@ -8,7 +8,7 @@ import * as moment from 'moment'; import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { DossiersService } from '../../../dossier/services/dossiers.service'; 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 627166a6e..ac29cfe69 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 @@ -7,7 +7,7 @@ import { HttpClient } from '@angular/common/http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { debounce } from '@utils/debounce'; import { WatermarkControllerService, WatermarkModelRes } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { ActivatedRoute } from '@angular/router'; import { BASE_HREF } from '../../../../tokens'; import { stampPDFPage } from '../../../../utils/page-stamper'; diff --git a/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts b/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts new file mode 100644 index 000000000..571ebbeae --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts @@ -0,0 +1,18 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +const auditCategoriesTranslations: { [key: string]: string } = { + allCategories: _('audit-screen.categories.all-categories'), + LICENSE: _('audit-screen.categories.license'), + DOWNLOAD: _('audit-screen.categories.download'), + AUDIT_LOG: _('audit-screen.categories.audit-log'), + PROJECT: _('audit-screen.categories.project'), + DOSSIER: _('audit-screen.categories.dossier'), + DICTIONARY: _('audit-screen.categories.dictionary'), + PROJECT_TEMPLATE: _('audit-screen.categories.project-template'), + USER: _('audit-screen.categories.user'), + DOCUMENT: _('audit-screen.categories.document'), + AUDIT: _('audit-screen.categories.audit'), + DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template') +}; + +export default auditCategoriesTranslations; diff --git a/apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts b/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts similarity index 86% rename from apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts rename to apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts index fe4b1b65c..b3c9e7a63 100644 --- a/apps/red-ui/src/app/modules/admin/translations/default-color-translations.ts +++ b/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts @@ -1,7 +1,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DefaultColorType } from '@models/default-color-key.model'; -const translations: { [key in DefaultColorType]: string } = { +const defaultColorsTranslations: { [key in DefaultColorType]: string } = { analysisColor: _('default-colors-screen.types.analysisColor'), defaultColor: _('default-colors-screen.types.defaultColor'), dictionaryRequestColor: _('default-colors-screen.types.dictionaryRequestColor'), @@ -13,4 +13,4 @@ const translations: { [key in DefaultColorType]: string } = { updatedColor: _('default-colors-screen.types.updatedColor') }; -export default translations; +export default defaultColorsTranslations; diff --git a/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts b/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts new file mode 100644 index 000000000..8a3bf1c45 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts @@ -0,0 +1,11 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { DossierAttributeConfig } from '@redaction/red-ui-http'; + +const dossierAttributeTypesTranslations: { [key in DossierAttributeConfig.TypeEnum]: string } = { + TEXT: _('dossier-attribute-types.text'), + NUMBER: _('dossier-attribute-types.number'), + DATE: _('dossier-attribute-types.date'), + IMAGE: _('dossier-attribute-types.image') +}; + +export default dossierAttributeTypesTranslations; 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 b905907b7..1bede8dac 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 @@ -6,9 +6,9 @@ import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { FileActionService } from '../../services/file-action.service'; import { from, Observable } from 'rxjs'; import { DossiersDialogService } from '../../services/dossiers-dialog.service'; -import { LoadingService } from '../../../../services/loading.service'; -import { ConfirmationDialogInput } from '../../../shared/dialogs/confirmation-dialog/confirmation-dialog.component'; -import { ScreenStateService } from '../../../shared/services/screen-state.service'; +import { LoadingService } from '@services/loading.service'; +import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component'; +import { ScreenStateService } from '@shared/services/screen-state.service'; import { TranslateService } from '@ngx-translate/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; 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 5ad0f88f5..feb1885e7 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 @@ -7,8 +7,8 @@ import { TranslateChartService } from '@services/translate-chart.service'; import { StatusSorter } from '@utils/sorters/status-sorter'; import { UserService } from '@services/user.service'; import { User } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; -import { FilterService } from '../../../shared/services/filter.service'; +import { Toaster } from '@services/toaster.service'; +import { FilterService } from '@shared/services/filter.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; @Component({ diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index 1555cef37..8a03fed66 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -3,8 +3,8 @@ import { PermissionsService } from '@services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; import { FileDataModel } from '../../../../models/file/file-data.model'; -import { Toaster } from '../../../../services/toaster.service'; -import { LoadingService } from '../../../../services/loading.service'; +import { Toaster } from '@services/toaster.service'; +import { LoadingService } from '@services/loading.service'; @Component({ selector: 'redaction-page-exclusion', 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 665fa19c8..8d8663ad7 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 @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Dossier } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { UserService } from '@services/user.service'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { DossierWrapper } from '@state/model/dossier.wrapper'; 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 b82a86f1d..96855bd5a 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 @@ -3,7 +3,7 @@ import { StatusControllerService } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AppStateService } from '@state/app-state.service'; import { UserService } from '@services/user.service'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { DossierWrapper } from '@state/model/dossier.wrapper'; 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 869f3c9a2..04aa51429 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 @@ -4,7 +4,7 @@ import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierGeneralInfoComponent } from './general-info/edit-dossier-general-info.component'; import { EditDossierDownloadPackageComponent } from './download-package/edit-dossier-download-package.component'; import { EditDossierSectionInterface } from './edit-dossier-section.interface'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { EditDossierDictionaryComponent } from './dictionary/edit-dossier-dictionary.component'; import { EditDossierTeamMembersComponent } from './team-members/edit-dossier-team-members.component'; import { EditDossierAttributesComponent } from './attributes/edit-dossier-attributes.component'; 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 dc52079f7..5662dbaa8 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 @@ -10,7 +10,7 @@ import { PermissionsService } from '@services/permissions.service'; import { Router } from '@angular/router'; import { MatDialogRef } from '@angular/material/dialog'; import { EditDossierDialogComponent } from '../edit-dossier-dialog.component'; -import { Toaster } from '../../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; @Component({ selector: 'redaction-edit-dossier-general-info', 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 c3de99226..d5f1293c4 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 @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MatDialogRef } from '@angular/material/dialog'; import { ForceRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; import { ManualAnnotationService } from '../../services/manual-annotation.service'; 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 b5c5d24df..381c37e36 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 @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AddRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper'; 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 a5312e1e2..bef95068a 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 @@ -28,7 +28,7 @@ import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { SortingService } from '@services/sorting.service'; -import { TableColConfig } from '../../../shared/components/table-col-name/table-col-name.component'; +import { TableColConfig } from '@shared/components/table-col-name/table-col-name.component'; const isLeavingScreen = event => event instanceof NavigationStart && event.url !== '/main/dossiers'; 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 e41bfde75..1c1cad6b2 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 @@ -1,6 +1,6 @@ import { ChangeDetectorRef, Component, ElementRef, HostListener, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NavigationStart, Router } from '@angular/router'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { AppStateService } from '@state/app-state.service'; import { FileDropOverlayService } from '@upload-download/services/file-drop-overlay.service'; import { FileUploadModel } from '@upload-download/model/file-upload.model'; @@ -26,12 +26,12 @@ import { ActionConfig } from '@shared/components/page-header/models/action-confi import { FilterService } from '@shared/services/filter.service'; import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; -import { SortingService } from '../../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { LoadingService } from '@services/loading.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; -import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { UserPreferenceService } from '@services/user-preference.service'; @Component({ templateUrl: './dossier-overview-screen.component.html', 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 5552393f2..8acbcbf0d 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 @@ -12,7 +12,7 @@ import { AnnotationData, FileDataModel } from '@models/file/file-data.model'; import { FileActionService } from '../../services/file-action.service'; import { AnnotationDrawService } from '../../services/annotation-draw.service'; import { AnnotationProcessingService } from '../../services/annotation-processing.service'; -import { Toaster } from '../../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { PermissionsService } from '@services/permissions.service'; import { Subscription, timer } from 'rxjs'; @@ -33,10 +33,10 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service'; import { OnAttach, OnDetach } from '@utils/custom-route-reuse.strategy'; import { FilterModel } from '@shared/components/filters/popup-filter/model/filter.model'; import { handleFilterDelta, processFilters } from '@shared/components/filters/popup-filter/utils/filter-utils'; -import { LoadingService } from '../../../../services/loading.service'; +import { LoadingService } from '@services/loading.service'; import { stampPDFPage } from '../../../../utils/page-stamper'; import { TranslateService } from '@ngx-translate/core'; -import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; +import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; 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 102baff26..4de092d50 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 @@ -7,7 +7,7 @@ import { ManualRedactionControllerService } from '@redaction/red-ui-http'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; -import { Toaster } from '../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { tap } from 'rxjs/operators'; import { UserService } from '@services/user.service'; 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 a396f5cb8..bad413569 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 @@ -1,13 +1,13 @@ import { Component, Injector, OnDestroy, ViewChild } from '@angular/core'; import { SortingOrders, SortingService } from '@services/sorting.service'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; -import { FilterService } from '../services/filter.service'; import { SearchService } from '../services/search.service'; import { ScreenStateService } from '../services/screen-state.service'; import { combineLatest, Observable } from 'rxjs'; import { AutoUnsubscribeComponent } from './auto-unsubscribe.component'; import { distinctUntilChanged, map } from 'rxjs/operators'; -import { PermissionsService } from '../../../services/permissions.service'; +import { PermissionsService } from '@services/permissions.service'; +import { FilterService } from '../services/filter.service'; @Component({ template: '' }) export abstract class BaseListingComponent extends AutoUnsubscribeComponent implements OnDestroy { diff --git a/apps/red-ui/src/app/modules/shared/pipes/sort-by.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/sort-by.pipe.ts index f9275b187..bb2ade371 100644 --- a/apps/red-ui/src/app/modules/shared/pipes/sort-by.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/sort-by.pipe.ts @@ -1,5 +1,5 @@ import { Pipe, PipeTransform } from '@angular/core'; -import { SortingService } from '../../../services/sorting.service'; +import { SortingService } from '@services/sorting.service'; @Pipe({ name: 'sortBy' }) export class SortByPipe implements PipeTransform { 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 5bce425e3..1f74a33d5 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 @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Observable, throwError } from 'rxjs'; -import { Toaster } from '../../../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { DictionaryControllerService } from '@redaction/red-ui-http'; import { tap } from 'rxjs/operators'; 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 ce9146e7d..22486ceb1 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -9,7 +9,7 @@ import { ReanalysisControllerService, StatusControllerService } from '@redaction/red-ui-http'; -import { Toaster } from '../services/toaster.service'; +import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { Event, NavigationEnd, ResolveStart, Router } from '@angular/router'; import { UserService } from '@services/user.service'; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 865f88981..76a053f06 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -300,17 +300,17 @@ "all-users": "All Users", "categories": { "all-categories": "All Categories", - "LICENSE": "License", - "DOWNLOAD": "Download", - "AUDIT_LOG": "Audit Log", - "PROJECT": "Project", - "DOSSIER": "Dossier", - "DICTIONARY": "Dictionary", - "PROJECT_TEMPLATE": "Project Template", - "USER": "User", - "DOCUMENT": "Document", - "AUDIT": "Audit", - "DOSSIER_TEMPLATE": "Dossier Template" + "license": "License", + "download": "Download", + "audit-log": "Audit Log", + "project": "Project", + "dossier": "Dossier", + "dictionary": "Dictionary", + "project-template": "Project Template", + "user": "User", + "document": "Document", + "audit": "Audit", + "dossier-template": "Dossier Template" }, "no-data": { "title": "No available logs." @@ -367,32 +367,20 @@ }, "configurations": "Configurations", "confirm-delete-file-attribute": { - "cancel": { - "bulk": "Keep Attributes", - "single": "Keep Attribute" - }, - "delete": { - "bulk": "Delete Attributes", - "single": "Delete Attribute" - }, - "impacted-documents": { - "bulk": "All documents they are used on will be impacted", - "single": "All documents it is used on will be impacted" - }, + "cancel": "Keep {type, select, single{Attribute} bulk{Attributes} other{}}", + "delete": "Delete {type, select, single{Attribute} bulk{Attributes} other{}}", + "impacted-documents": "All documents {type, select, single{it is} bulk{they are} other{}} used on will be impacted", "lost-details": "All inputted details on the documents will be lost", - "title": { - "bulk": "Delete File Attributes", - "single": "Delete {name}" - }, + "title": "Delete {type, select, single{{name}} bulk{File Attributes} other{}}", "toast-error": "Please confirm that you understand the ramifications of your action!", "warning": "Warning: this cannot be undone!" }, "confirm-delete-users": { - "cancel": "Keep {userCount, plural, =0{} one{User} other{Users}}", - "delete": "Delete {userCount, plural, =0{} one{User} other{Users}}", - "impacted-documents": "All documents pending review from the {userCount, plural, =0{} one{user} other{users}} will be impacted", + "cancel": "Keep {usersCount, plural, =0{} one{User} other{Users}}", + "delete": "Delete {usersCount, plural, =0{} one{User} other{Users}}", + "impacted-documents": "All documents pending review from the {usersCount, plural, =0{} one{user} other{users}} will be impacted", "impacted-dossiers": "{dossiersCount} {dossiersCount, plural, =0{dossiers} one{dossier} other{dossiers}} will be impacted", - "title": "Delete {userCount, plural, =0{} one{User} other{Users}} from Workspace", + "title": "Delete {usersCount, plural, =0{} one{User} other{Users}} from Workspace", "toast-error": "Please confirm that you understand the ramifications of your action!", "warning": "Warning: this cannot be undone!" }, @@ -548,10 +536,10 @@ "title": "Introduce File Attributes" }, "dossier-attribute-types": { - "DATE": "Date", - "NUMBER": "Number", - "TEXT": "Free Text", - "IMAGE": "Image" + "date": "Date", + "number": "Number", + "text": "Free Text", + "image": "Image" }, "dossier-attributes": "Dossier Attributes", "dossier-attributes-listing": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index a1f76881c..5ceeecd92 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -16,10 +16,6 @@ "save": "", "save-and-add-members": "" }, - "errors": { - "dossier-already-exists": "", - "generic": "" - }, "form": { "description": { "label": "", @@ -161,7 +157,18 @@ "audit": "", "audit-screen": { "categories": { - "": "" + "all-categories": "", + "audit": "", + "audit-log": "", + "dictionary": "", + "document": "", + "dossier": "", + "dossier-template": "", + "download": "", + "license": "", + "project": "", + "project-template": "", + "user": "" }, "no-data": { "title": "" @@ -213,9 +220,11 @@ }, "configurations": "", "confirm-delete-file-attribute": { - "cancel": { - "": "" - }, + "cancel": "", + "delete": "", + "impacted-documents": "", + "lost-details": "", + "title": "", "toast-error": "", "warning": "" }, @@ -261,7 +270,6 @@ "title": "" }, "types": { - "": "", "analysisColor": "", "defaultColor": "", "dictionaryRequestColor": "", @@ -319,29 +327,17 @@ "dictionary-details": { "description": "" }, - "error": { - "entries-too-short": "", - "generic": "" - }, "revert-changes": "", "save-changes": "", "search": "", - "select-dictionary": "", - "success": { - "generic": "" - } + "select-dictionary": "" }, "digital-signature": "", "digital-signature-screen": { "action": { - "certificate-not-valid-error": "", "delete": "", - "delete-error": "", - "delete-success": "", "reset": "", - "save": "", - "save-error": "", - "save-success": "" + "save": "" }, "certificate-name": { "label": "", @@ -372,6 +368,12 @@ "save": "", "title": "" }, + "dossier-attribute-types": { + "date": "", + "image": "", + "number": "", + "text": "" + }, "dossier-attributes-listing": { "action": { "edit": "" @@ -390,6 +392,7 @@ "search": "", "table-col-names": { "label": "", + "placeholder": "", "type": "" }, "table-header": { @@ -443,9 +446,6 @@ "needs-work": "", "owner": "", "status": "" - }, - "table-header": { - "title": "" } }, "dossier-overview": { @@ -512,10 +512,6 @@ "recent": "", "unassigned": "" }, - "reanalyse-dossier": { - "error": "", - "success": "" - }, "reanalyse": { "action": "" }, @@ -563,15 +559,7 @@ "title": "" } }, - "dossiers": { - "delete": { - "delete-failed": "" - } - }, "download-includes": "", - "download-status": { - "queued": "" - }, "download-type": { "label": "" }, @@ -594,13 +582,11 @@ } }, "edit-color-dialog": { - "error": "", "form": { "color": "", "color-placeholder": "" }, - "save": "", - "success": "" + "save": "" }, "edit-dossier-dialog": { "actions": { @@ -613,8 +599,6 @@ "image-attributes": "", "upload-image": "" }, - "change-successful": "", - "delete-successful": "", "dictionary": { "entries": "" }, @@ -643,8 +627,7 @@ "general-info": "", "members": "", "team-members": "" - }, - "unsaved-changes": "" + } }, "file-attribute-types": { "": "" @@ -676,9 +659,7 @@ "none": "" }, "save": { - "error": "", - "label": "", - "success": "" + "label": "" }, "search": { "placeholder": "" @@ -780,7 +761,6 @@ }, "exclude-pages": { "close": "", - "error": "", "hint": "", "input-placeholder": "", "label": "", @@ -946,14 +926,8 @@ "NO_ROLE": "" }, "rules-screen": { - "error": { - "generic": "" - }, "revert-changes": "", - "save-changes": "", - "success": { - "generic": "" - } + "save-changes": "" }, "smtp-auth-config": { "actions": { @@ -1001,10 +975,6 @@ "title": "" }, "subtitle": "", - "test": { - "error": "", - "success": "" - }, "title": "" }, "top-bar": { @@ -1104,9 +1074,6 @@ }, "watermark-screen": { "action": { - "change-success": "", - "delete-success": "", - "error": "", "revert": "", "save": "" }, From 3894c1e95c7df027a6842084eb2c531e1d2892a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 21 Jul 2021 14:28:43 +0300 Subject: [PATCH 13/25] Translation rework: file attribute types, languages --- .../user-profile/user-profile-screen.component.html | 2 +- .../user-profile/user-profile-screen.component.ts | 2 ++ .../add-edit-dossier-attribute-dialog.component.ts | 2 +- .../add-edit-file-attribute-dialog.component.html | 2 +- .../add-edit-file-attribute-dialog.component.ts | 2 ++ .../edit-color-dialog/edit-color-dialog.component.ts | 2 +- .../active-fields-listing.component.html | 4 ++-- .../active-fields-listing.component.ts | 2 ++ .../modules/admin/screens/audit/audit-screen.component.ts | 2 +- .../default-colors/default-colors-screen.component.ts | 2 +- .../dossier-attributes-listing-screen.component.ts | 2 +- .../file-attributes-listing-screen.component.html | 2 +- .../file-attributes-listing-screen.component.ts | 3 ++- .../admin/translations/audit-categories-translations.ts | 4 +--- .../admin/translations/default-colors-translations.ts | 4 +--- .../translations/dossier-attribute-types-translations.ts | 4 +--- .../translations/file-attribute-types-translations.ts | 8 ++++++++ .../red-ui/src/app/translations/languages-translations.ts | 6 ++++++ apps/red-ui/src/assets/i18n/en.json | 6 +++--- apps/red-ui/src/assets/i18n/te.json | 6 +++++- 20 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 apps/red-ui/src/app/modules/admin/translations/file-attribute-types-translations.ts create mode 100644 apps/red-ui/src/app/translations/languages-translations.ts diff --git a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html index d3b76e294..acd38e4a6 100644 --- a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html +++ b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.html @@ -26,7 +26,7 @@ - {{ 'top-bar.navigation-items.my-account.children.language.' + language | translate }} + {{ translations[language] | translate }}
diff --git a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.ts b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.ts index 359cf01de..79a60257a 100644 --- a/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/components/user-profile/user-profile-screen.component.ts @@ -7,6 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { UserControllerService } from '@redaction/red-ui-http'; import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import { DomSanitizer } from '@angular/platform-browser'; +import { languagesTranslations } from '../../translations/languages-translations'; @Component({ selector: 'redaction-user-profile-screen', @@ -17,6 +18,7 @@ export class UserProfileScreenComponent implements OnInit { viewReady = false; formGroup: FormGroup; changePasswordUrl: any; + translations = languagesTranslations; private _profileModel: ProfileModel; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts index b21f61273..5a35385c2 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts @@ -8,7 +8,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Toaster } from '@services/toaster.service'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; -import dossierAttributeTypesTranslations from '../../translations/dossier-attribute-types-translations'; +import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations'; @Component({ selector: 'redaction-add-edit-dossier-attribute-dialog', diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html index a27a36051..0349c10f9 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html @@ -32,7 +32,7 @@ - {{ 'file-attribute-types.' + type | translate }} + {{ translations[type] | translate }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts index c24f4576f..692d3961e 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts @@ -3,6 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { FileAttributeConfig } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { fileAttributeTypesTranslations } from '../../translations/file-attribute-types-translations'; @Component({ selector: 'redaction-add-edit-file-attribute-dialog', @@ -14,6 +15,7 @@ export class AddEditFileAttributeDialogComponent { fileAttribute: FileAttributeConfig; dossierTemplateId: string; readonly typeOptions = [FileAttributeConfig.TypeEnum.TEXT, FileAttributeConfig.TypeEnum.NUMBER, FileAttributeConfig.TypeEnum.DATE]; + translations = fileAttributeTypesTranslations; constructor( private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index 25b058ef0..864ffbb23 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -5,7 +5,7 @@ import { Toaster } from '@services/toaster.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { DefaultColorType } from '@models/default-color-key.model'; -import defaultColorsTranslations from '../../translations/default-colors-translations'; +import { defaultColorsTranslations } from '../../translations/default-colors-translations'; @Component({ selector: 'redaction-edit-color-dialog', diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index f03412ce2..8862210d7 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -47,7 +47,7 @@ @@ -134,7 +134,7 @@ - {{ 'file-attribute-types.' + type | translate }} + {{ translations[type] | translate }} 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 5068b98b5..953f2e87e 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 @@ -6,6 +6,7 @@ import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; +import { fileAttributeTypesTranslations } from '../../../translations/file-attribute-types-translations'; @Component({ selector: 'redaction-active-fields-listing', @@ -18,6 +19,7 @@ export class ActiveFieldsListingComponent extends BaseListingComponent im @Output() entitiesChange = new EventEmitter(); @Output() setHoveredColumn = new EventEmitter(); @Output() toggleFieldActive = new EventEmitter(); + translations = fileAttributeTypesTranslations; readonly typeOptions = [FileAttributeConfig.TypeEnum.TEXT, FileAttributeConfig.TypeEnum.NUMBER, FileAttributeConfig.TypeEnum.DATE]; protected readonly _primaryKey = 'id'; 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 eea6367a4..5aaca396d 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 @@ -6,7 +6,7 @@ import { Moment } from 'moment'; import { applyIntervalConstraints } from '@utils/date-inputs-utils'; import { LoadingService } from '@services/loading.service'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; -import auditCategoriesTranslations from '../../translations/audit-categories-translations'; +import { auditCategoriesTranslations } from '../../translations/audit-categories-translations'; const PAGE_SIZE = 50; 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 6cceafce2..5dae2be05 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 @@ -11,7 +11,7 @@ import { ScreenStateService } from '@shared/services/screen-state.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { DefaultColorType } from '@models/default-color-key.model'; import { SortingService } from '@services/sorting.service'; -import defaultColorsTranslations from '../../translations/default-colors-translations'; +import { defaultColorsTranslations } from '../../translations/default-colors-translations'; @Component({ templateUrl: './default-colors-screen.component.html', diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts index 17ebdf541..3feeccebc 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.ts @@ -11,7 +11,7 @@ import { SearchService } from '@shared/services/search.service'; import { ScreenStateService } from '@shared/services/screen-state.service'; import { PermissionsService } from '@services/permissions.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; -import dossierAttributeTypesTranslations from '../../translations/dossier-attribute-types-translations'; +import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations'; @Component({ templateUrl: './dossier-attributes-listing-screen.component.html', diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index afdfafadc..1edc6b311 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -130,7 +130,7 @@ {{ attribute.label }}
-
+
implements OnInit, OnDestroy { + translations = fileAttributeTypesTranslations; protected readonly _primaryKey = 'label'; - private _existingConfiguration: FileAttributesConfig; @ViewChild('fileInput') private _fileInput: ElementRef; diff --git a/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts b/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts index 571ebbeae..82a25e8a7 100644 --- a/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts +++ b/apps/red-ui/src/app/modules/admin/translations/audit-categories-translations.ts @@ -1,6 +1,6 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -const auditCategoriesTranslations: { [key: string]: string } = { +export const auditCategoriesTranslations: { [key: string]: string } = { allCategories: _('audit-screen.categories.all-categories'), LICENSE: _('audit-screen.categories.license'), DOWNLOAD: _('audit-screen.categories.download'), @@ -14,5 +14,3 @@ const auditCategoriesTranslations: { [key: string]: string } = { AUDIT: _('audit-screen.categories.audit'), DOSSIER_TEMPLATE: _('audit-screen.categories.dossier-template') }; - -export default auditCategoriesTranslations; diff --git a/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts b/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts index b3c9e7a63..f14212fcb 100644 --- a/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts +++ b/apps/red-ui/src/app/modules/admin/translations/default-colors-translations.ts @@ -1,7 +1,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DefaultColorType } from '@models/default-color-key.model'; -const defaultColorsTranslations: { [key in DefaultColorType]: string } = { +export const defaultColorsTranslations: { [key in DefaultColorType]: string } = { analysisColor: _('default-colors-screen.types.analysisColor'), defaultColor: _('default-colors-screen.types.defaultColor'), dictionaryRequestColor: _('default-colors-screen.types.dictionaryRequestColor'), @@ -12,5 +12,3 @@ const defaultColorsTranslations: { [key in DefaultColorType]: string } = { requestRemove: _('default-colors-screen.types.requestRemove'), updatedColor: _('default-colors-screen.types.updatedColor') }; - -export default defaultColorsTranslations; diff --git a/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts b/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts index 8a3bf1c45..bb325e3c9 100644 --- a/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts +++ b/apps/red-ui/src/app/modules/admin/translations/dossier-attribute-types-translations.ts @@ -1,11 +1,9 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DossierAttributeConfig } from '@redaction/red-ui-http'; -const dossierAttributeTypesTranslations: { [key in DossierAttributeConfig.TypeEnum]: string } = { +export const dossierAttributeTypesTranslations: { [key in DossierAttributeConfig.TypeEnum]: string } = { TEXT: _('dossier-attribute-types.text'), NUMBER: _('dossier-attribute-types.number'), DATE: _('dossier-attribute-types.date'), IMAGE: _('dossier-attribute-types.image') }; - -export default dossierAttributeTypesTranslations; diff --git a/apps/red-ui/src/app/modules/admin/translations/file-attribute-types-translations.ts b/apps/red-ui/src/app/modules/admin/translations/file-attribute-types-translations.ts new file mode 100644 index 000000000..5262ab6c9 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/translations/file-attribute-types-translations.ts @@ -0,0 +1,8 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { FileAttributeConfig } from '@redaction/red-ui-http'; + +export const fileAttributeTypesTranslations: { [key in FileAttributeConfig.TypeEnum]: string } = { + TEXT: _('file-attribute-types.text'), + NUMBER: _('file-attribute-types.number'), + DATE: _('file-attribute-types.date') +}; diff --git a/apps/red-ui/src/app/translations/languages-translations.ts b/apps/red-ui/src/app/translations/languages-translations.ts new file mode 100644 index 000000000..412f98128 --- /dev/null +++ b/apps/red-ui/src/app/translations/languages-translations.ts @@ -0,0 +1,6 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const languagesTranslations: { [key: string]: string } = { + en: _('top-bar.navigation-items.my-account.children.language.en'), + de: _('top-bar.navigation-items.my-account.children.language.de') +}; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 76a053f06..c9f49e3cd 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -842,9 +842,9 @@ }, "efsa": "EFSA Approval", "file-attribute-types": { - "DATE": "Date", - "NUMBER": "Number", - "TEXT": "Free Text" + "date": "Date", + "number": "Number", + "text": "Free Text" }, "file-attributes": "File Attributes", "file-attributes-csv-import": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 5ceeecd92..0b65dfbee 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -630,7 +630,9 @@ } }, "file-attribute-types": { - "": "" + "date": "", + "number": "", + "text": "" }, "file-attributes-csv-import": { "action": { @@ -984,6 +986,8 @@ "my-account": { "children": { "language": { + "de": "", + "en": "", "label": "" }, "logout": "" From 99c9cba3251d744ff4c3ba08b58054c41427879b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 21 Jul 2021 14:38:13 +0300 Subject: [PATCH 14/25] Translation rework: roles --- .../user-details/user-details.component.html | 2 +- .../user-details/user-details.component.ts | 2 ++ .../user-listing-screen.component.ts | 6 ++++-- .../initials-avatar/initials-avatar.component.ts | 6 +++--- .../src/app/services/translate-chart.service.ts | 5 ++++- .../src/app/translations/roles-translations.ts | 12 ++++++++++++ apps/red-ui/src/assets/i18n/en.json | 16 ++++++++-------- apps/red-ui/src/assets/i18n/te.json | 9 ++++++++- 8 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 apps/red-ui/src/app/translations/roles-translations.ts diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html index cdae4789e..9ee996f81 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html @@ -23,7 +23,7 @@
- {{ 'roles.' + role | translate }} + {{ translations[role] | translate }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts index 1cc9e3dd6..3fe562f79 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.ts @@ -3,6 +3,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { User, UserControllerService } from '@redaction/red-ui-http'; import { AdminDialogService } from '../../../services/admin-dialog.service'; import { LoadingService } from '@services/loading.service'; +import { rolesTranslations } from '../../../../../translations/roles-translations'; @Component({ selector: 'redaction-user-details', @@ -15,6 +16,7 @@ export class UserDetailsComponent implements OnInit { @Output() closeDialog = new EventEmitter(); userForm: FormGroup; readonly ROLES = ['RED_USER', 'RED_MANAGER', 'RED_USER_ADMIN', 'RED_ADMIN']; + translations = rolesTranslations; private readonly _ROLE_REQUIREMENTS = { RED_MANAGER: 'RED_USER', RED_ADMIN: 'RED_USER_ADMIN' }; constructor( 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 935c29cf4..f22bf6f97 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 @@ -15,6 +15,7 @@ import { SortingService } from '@services/sorting.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { rolesTranslations } from '../../../../translations/roles-translations'; @Component({ templateUrl: './user-listing-screen.component.html', @@ -25,6 +26,7 @@ export class UserListingScreenComponent extends BaseListingComponent imple readonly canDeleteSelected$ = this._canDeleteSelected$; collapsedDetails = false; chartData: DoughnutChartConfig[] = []; + translations = rolesTranslations; protected readonly _primaryKey = 'userId'; @ViewChildren(InitialsAvatarComponent) private readonly _avatars: QueryList; @@ -65,8 +67,8 @@ export class UserListingScreenComponent extends BaseListingComponent imple getDisplayRoles(user: User) { return ( - user.roles.map(role => this._translateService.instant('roles.' + role)).join(', ') || - this._translateService.instant('roles.NO_ROLE') + user.roles.map(role => this._translateService.instant(this.translations[role])).join(', ') || + this._translateService.instant(this.translations['NO_ROLE']) ); } 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 c7157206e..ce0e9d4cd 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 @@ -71,12 +71,12 @@ export class InitialsAvatarComponent implements OnChanges, OnDestroy { this.user = this._userService.getUserById(this.userId); this.displayName = this._userService.getNameForId(this.userId); + this.initials = this._getInitials(); + this.colorClass = this._colorClass; + if (this.showYou && this._isCurrentUser) { this.displayName += ` (${this._translateService.instant('initials-avatar.you')})`; } - - this.initials = this._getInitials(); - this.colorClass = this._colorClass; } detectChanges(): void { 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 581b4a467..d2930ebaa 100644 --- a/apps/red-ui/src/app/services/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -1,11 +1,14 @@ import { Injectable } from '@angular/core'; import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { TranslateService } from '@ngx-translate/core'; +import { rolesTranslations } from '../translations/roles-translations'; @Injectable({ providedIn: 'root' }) export class TranslateChartService { + translations = rolesTranslations; + constructor(private readonly _translateService: TranslateService) {} translateStatus(config: DoughnutChartConfig[]): DoughnutChartConfig[] { @@ -15,7 +18,7 @@ export class TranslateChartService { translateRoles(config: DoughnutChartConfig[]): DoughnutChartConfig[] { return config.map(val => ({ ...val, - label: this._translateService.instant(`roles.${val.label}`).toLowerCase() + label: this._translateService.instant(this.translations[val.label]).toLowerCase() })); } } diff --git a/apps/red-ui/src/app/translations/roles-translations.ts b/apps/red-ui/src/app/translations/roles-translations.ts new file mode 100644 index 000000000..1c3385af4 --- /dev/null +++ b/apps/red-ui/src/app/translations/roles-translations.ts @@ -0,0 +1,12 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const rolesTranslations: { [key in string]: string } = { + INACTIVE: _('roles.inactive'), + MANAGER_ADMIN: _('roles.manager-admin'), + NO_ROLE: _('roles.no-role'), + RED_ADMIN: _('roles.red-admin'), + RED_MANAGER: _('roles.red-manager'), + RED_USER: _('roles.red-user'), + RED_USER_ADMIN: _('roles.red-user-admin'), + REGULAR: _('roles.regular') +}; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index c9f49e3cd..5403de27c 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1190,14 +1190,14 @@ } }, "roles": { - "INACTIVE": "Inactive", - "MANAGER_ADMIN": "Manager & Admin", - "NO_ROLE": "No role defined", - "RED_ADMIN": "Application Admin", - "RED_MANAGER": "Manager", - "RED_USER": "User", - "RED_USER_ADMIN": "Users Admin", - "REGULAR": "Regular" + "inactive": "Inactive", + "manager-admin": "Manager & Admin", + "no-role": "No role defined", + "red-admin": "Application Admin", + "red-manager": "Manager", + "red-user": "User", + "red-user-admin": "Users Admin", + "regular": "Regular" }, "rule-editor": "Rule Editor", "rules-screen": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 0b65dfbee..251a6705b 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -925,7 +925,14 @@ "header": "" }, "roles": { - "NO_ROLE": "" + "inactive": "", + "manager-admin": "", + "no-role": "", + "red-admin": "", + "red-manager": "", + "red-user": "", + "red-user-admin": "", + "regular": "" }, "rules-screen": { "revert-changes": "", From 588f657192d9d1fd3e7d5456332d5afb219d098d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 21 Jul 2021 15:10:28 +0300 Subject: [PATCH 15/25] Translation rework: add/edit titles --- .../add-edit-dictionary-dialog.component.ts | 4 +- ...it-dossier-attribute-dialog.component.html | 14 ++++--- ...dit-dossier-template-dialog.component.html | 14 ++++--- ...-edit-file-attribute-dialog.component.html | 14 ++++--- .../user-details/user-details.component.html | 10 +++-- .../file-workload.component.html | 2 +- .../file-workload/file-workload.component.ts | 9 +---- apps/red-ui/src/assets/i18n/en.json | 38 ++++++------------- 8 files changed, 46 insertions(+), 59 deletions(-) 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 eb80f32d9..592e389ae 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 @@ -41,8 +41,8 @@ export class AddEditDictionaryDialogComponent { } get dialogHeader(): string { - const i18nString = 'add-edit-dictionary.title.' + (this.dictionary ? 'edit' : 'new'); - return this._translateService.instant(i18nString, { + return this._translateService.instant('add-edit-dictionary.title', { + type: this.dictionary ? 'edit' : 'create', name: humanize(this.dictionary?.type) }); } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html index ea0ada166..5a4f29102 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.html @@ -1,10 +1,12 @@
-
- {{ - (dossierAttribute ? 'add-edit-dossier-attribute.title.edit' : 'add-edit-dossier-attribute.title.new') - | translate: { name: dossierAttribute?.label } - }} -
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html index cf1d10da9..6bf2167c7 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html @@ -1,10 +1,12 @@
-
- {{ - (dossierTemplate ? 'add-edit-dossier-template.title.edit' : 'add-edit-dossier-template.title.new') - | translate: { name: dossierTemplate?.name } - }} -
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html index 0349c10f9..d2dba3279 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html @@ -1,10 +1,12 @@
-
- {{ - (fileAttribute ? 'add-edit-file-attribute.title.edit' : 'add-edit-file-attribute.title.new') - | translate: { name: fileAttribute?.label } - }} -
+
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html index 9ee996f81..a770d5ae2 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-user-dialog/user-details/user-details.component.html @@ -1,6 +1,10 @@ -
- {{ (user ? 'add-edit-user.title.edit' : 'add-edit-user.title.new') | translate }} -
+
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html index 3432287b6..fa3d8f453 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.html @@ -202,7 +202,7 @@
diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts index 397df5070..57cde0bb2 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts @@ -20,7 +20,6 @@ import { FileDataModel } from '@models/file/file-data.model'; import { FilterModel } from '@shared/components/filters/popup-filter/model/filter.model'; import { CommentsComponent } from '../comments/comments.component'; import { PermissionsService } from '@services/permissions.service'; -import { TranslateService } from '@ngx-translate/core'; import { WebViewerInstance } from '@pdftron/webviewer'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; @@ -60,8 +59,7 @@ export class FileWorkloadComponent { constructor( private readonly _permissionsService: PermissionsService, private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _annotationProcessingService: AnnotationProcessingService, - private readonly _translateService: TranslateService + private readonly _annotationProcessingService: AnnotationProcessingService ) {} private _annotations: AnnotationWrapper[]; @@ -114,11 +112,6 @@ export class FileWorkloadComponent { } } - commentsTooltip({ comments }: AnnotationWrapper): string { - const i18nString = 'comments.' + (comments.length === 1 ? 'comment' : 'comments'); - return this._translateService.instant(i18nString, { count: comments.length }); - } - isSelected(annotation: AnnotationWrapper) { return this.selectedAnnotations?.find(a => a?.id === annotation.id); } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 5403de27c..ccc7111df 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -61,10 +61,7 @@ "redaction": "Redaction" }, "save": "Save Dictionary", - "title": { - "edit": "Edit {name} Dictionary", - "new": "Create Dictionary" - } + "title": "{type, select, edit{Edit {name}} create{Create} other{}} Dictionary" }, "add-edit-dossier-attribute": { "form": { @@ -74,10 +71,7 @@ "type": "Attribute Type" }, "save": "Save Attribute", - "title": { - "edit": "Edit {name} Dossier Attribute", - "new": "Add New Dossier Attribute" - }, + "title": "{type, select, edit{Edit {name}} create{Add New} other{}} Dossier Attribute", "error": { "generic": "Failed to save attribute!" } @@ -92,10 +86,7 @@ "valid-to": "Valid to" }, "save": "Save Dossier Template", - "title": { - "edit": "Edit {name} Dossier Template", - "new": "Create Dossier Template" - } + "title": "{type, select, edit{Edit {name}} create{Create} other{}} Dossier Template" }, "add-edit-file-attribute": { "form": { @@ -108,10 +99,7 @@ "type": "Type" }, "save": "Save Attribute", - "title": { - "edit": "Edit {name} File Attribute", - "new": "Add New File Attribute" - } + "title": "{type, select, edit{Edit {name}} create{Add New} other{}} File Attribute" }, "add-edit-user": { "actions": { @@ -127,10 +115,7 @@ "role": "Role", "reset-password": "Reset Password" }, - "title": { - "edit": "Edit User", - "new": "Add New User" - } + "title": "{type, select, edit{Edit} create{Add New} other{}} User" }, "annotation": "Annotation", "annotation-actions": { @@ -352,8 +337,7 @@ "comments": { "add-comment": "Enter comment", "cancel": "Cancel", - "comment": "{count} comment", - "comments": "{count} comments", + "comments": "{count} {count, plural, one{comment} other{comments}}", "hide-comments": "Hide comments" }, "common": { @@ -376,11 +360,11 @@ "warning": "Warning: this cannot be undone!" }, "confirm-delete-users": { - "cancel": "Keep {usersCount, plural, =0{} one{User} other{Users}}", - "delete": "Delete {usersCount, plural, =0{} one{User} other{Users}}", - "impacted-documents": "All documents pending review from the {usersCount, plural, =0{} one{user} other{users}} will be impacted", - "impacted-dossiers": "{dossiersCount} {dossiersCount, plural, =0{dossiers} one{dossier} other{dossiers}} will be impacted", - "title": "Delete {usersCount, plural, =0{} one{User} other{Users}} from Workspace", + "cancel": "Keep {usersCount, plural, one{User} other{Users}}", + "delete": "Delete {usersCount, plural, one{User} other{Users}}", + "impacted-documents": "All documents pending review from the {usersCount, plural, one{user} other{users}} will be impacted", + "impacted-dossiers": "{dossiersCount} {dossiersCount, plural, one{dossier} other{dossiers}} will be impacted", + "title": "Delete {usersCount, plural, one{User} other{Users}} from Workspace", "toast-error": "Please confirm that you understand the ramifications of your action!", "warning": "Warning: this cannot be undone!" }, From 0db16789d8d3ccd530bd33b7ab5f0e57269ecb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 21 Jul 2021 16:15:01 +0300 Subject: [PATCH 16/25] Translation rework: annotation supertypes, chevron button, others --- .../src/app/models/file/annotation.wrapper.ts | 43 ++-- .../active-fields-listing.component.html | 2 +- .../services/annotation-processing.service.ts | 3 +- .../chevron-button.component.html | 2 +- .../chevron-button.component.ts | 2 +- .../popup-filter/popup-filter.component.html | 4 +- .../popup-filter/popup-filter.component.ts | 2 +- .../annotation-types-translations.ts | 23 ++ .../app/utils/sorters/super-type-sorter.ts | 12 +- apps/red-ui/src/assets/i18n/en.json | 221 ++++++++---------- apps/red-ui/src/assets/i18n/te.json | 44 ++-- 11 files changed, 188 insertions(+), 170 deletions(-) create mode 100644 apps/red-ui/src/app/translations/annotation-types-translations.ts diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index d27d555d9..177f4cc9b 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -1,26 +1,29 @@ import { Comment, Point, Rectangle } from '@redaction/red-ui-http'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; +import { annotationTypesTranslations } from '../../translations/annotation-types-translations'; + +export type AnnotationSuperType = + | 'add-dictionary' + | 'remove-dictionary' + | 'remove-only-here' + | 'change-legal-basis' + | 'suggestion-change-legal-basis' + | 'suggestion-recategorize-image' + | 'suggestion-add-dictionary' + | 'suggestion-force-redaction' + | 'suggestion-remove-dictionary' + | 'suggestion-add' + | 'suggestion-remove' + | 'skipped' + | 'redaction' + | 'manual-redaction' + | 'recommendation' + | 'hint' + | 'pending-analysis' + | 'declined-suggestion'; export class AnnotationWrapper { - superType: - | 'add-dictionary' - | 'remove-dictionary' - | 'remove-only-here' - | 'change-legal-basis' - | 'suggestion-change-legal-basis' - | 'suggestion-recategorize-image' - | 'suggestion-add-dictionary' - | 'suggestion-force-redaction' - | 'suggestion-remove-dictionary' - | 'suggestion-add' - | 'suggestion-remove' - | 'skipped' - | 'redaction' - | 'manual-redaction' - | 'recommendation' - | 'hint' - | 'pending-analysis' - | 'declined-suggestion'; + superType: AnnotationSuperType; dictionary: string; color: string; @@ -213,7 +216,7 @@ export class AnnotationWrapper { this._createContent(annotationWrapper, redactionLogEntry); this._setSuperType(annotationWrapper, redactionLogEntry); this._handleRecommendations(annotationWrapper, redactionLogEntry); - annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType; + annotationWrapper.typeLabel = annotationTypesTranslations[annotationWrapper.superType]; return annotationWrapper; } diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html index 8862210d7..089ebd3e7 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html @@ -28,8 +28,8 @@
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 1cd4e3e57..c851a5a9c 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 @@ -3,6 +3,7 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { SuperTypeSorter } from '@utils/sorters/super-type-sorter'; import { FilterModel } from '@shared/components/filters/popup-filter/model/filter.model'; import { handleCheckedValue } from '@shared/components/filters/popup-filter/utils/filter-utils'; +import { annotationTypesTranslations } from '../../../translations/annotation-types-translations'; @Injectable() export class AnnotationProcessingService { @@ -126,7 +127,7 @@ export class AnnotationProcessingService { key: key, topLevelFilter: true, matches: 1, - label: 'annotation-type.' + key, + label: annotationTypesTranslations[key], filters: [] }; filterMap.set(key, filter); diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html index 6c26d9bb7..c15aa6378 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html +++ b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html @@ -1,5 +1,5 @@
diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts index 6c1329533..c6b9438ee 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts @@ -7,7 +7,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; changeDetection: ChangeDetectionStrategy.OnPush }) export class ChevronButtonComponent { - @Input() text: string; + @Input() label: string; @Input() showDot = false; @Input() primary = false; } diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html index 355b3c0a4..ab78f2597 100644 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html +++ b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html @@ -1,16 +1,16 @@ diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts index 296f0219d..943b7a21b 100644 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.ts @@ -27,7 +27,7 @@ export class PopupFilterComponent implements OnChanges { @Input() actionsTemplate: TemplateRef; @Input() primaryFilters: FilterModel[] = []; @Input() secondaryFilters: FilterModel[] = []; - @Input() filterLabel = this._translateService.instant('filter-menu.label'); + @Input() filterLabel; @Input() icon: string; @Input() chevron = false; diff --git a/apps/red-ui/src/app/translations/annotation-types-translations.ts b/apps/red-ui/src/app/translations/annotation-types-translations.ts new file mode 100644 index 000000000..e1917b831 --- /dev/null +++ b/apps/red-ui/src/app/translations/annotation-types-translations.ts @@ -0,0 +1,23 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { AnnotationSuperType } from '../models/file/annotation.wrapper'; + +export const annotationTypesTranslations: { [key in AnnotationSuperType]: string } = { + 'add-dictionary': _('annotation-type.add-dictionary'), + 'change-legal-basis': _('annotation-type.change-legal-basis'), + 'declined-suggestion': _('annotation-type.declined-suggestion'), + hint: _('annotation-type.hint'), + 'manual-redaction': _('annotation-type.manual-redaction'), + 'pending-analysis': _('annotation-type.pending-analysis'), + recommendation: _('annotation-type.recommendation'), + redaction: _('annotation-type.redaction'), + 'remove-dictionary': _('annotation-type.remove-dictionary'), + 'remove-only-here': _('annotation-type.remove-only-here'), + skipped: _('annotation-type.skipped'), + 'suggestion-add': _('annotation-type.suggestion-add'), + 'suggestion-add-dictionary': _('annotation-type.suggestion-add-dictionary'), + 'suggestion-change-legal-basis': _('annotation-type.suggestion-change-legal-basis'), + 'suggestion-recategorize-image': _('annotation-type.suggestion-recategorize-image'), + 'suggestion-force-redaction': _('annotation-type.suggestion-force-redaction'), + 'suggestion-remove': _('annotation-type.suggestion-remove'), + 'suggestion-remove-dictionary': _('suggestion-remove-dictionary') +}; diff --git a/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts b/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts index 4408f9b5a..47b500cb9 100644 --- a/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts +++ b/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts @@ -1,4 +1,10 @@ -export const SuperTypeSorter = { +import { AnnotationSuperType } from '../../models/file/annotation.wrapper'; + +export const SuperTypeSorter: { [key in AnnotationSuperType]: number } = { + 'suggestion-change-legal-basis': 14, + 'suggestion-force-redaction': 15, + 'suggestion-recategorize-image': 16, + recommendation: 7, 'add-dictionary': 2, 'remove-dictionary': 3, 'pending-analysis': 4, @@ -10,7 +16,7 @@ export const SuperTypeSorter = { 'suggestion-remove': 11, skipped: 50, redaction: 1, - manual: 2, - hint: 15, + 'manual-redaction': 2, + hint: 17, 'declined-suggestion': 20 }; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index ccc7111df..4987f501d 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1,15 +1,4 @@ { - "APPROVED": "Approved", - "ERROR": "Re-processing required", - "EXCLUDED": "Excluded", - "FULLREPROCESS": "Processing", - "OCR_PROCESSING": "OCR Processing", - "PROCESSING": "Processing", - "REPROCESS": "Processing", - "UNASSIGNED": "Unassigned", - "UNDER_APPROVAL": "Under Approval", - "UNDER_REVIEW": "Under Review", - "UNPROCESSED": "Unprocessed", "actions": { "all": "All", "none": "None" @@ -64,6 +53,9 @@ "title": "{type, select, edit{Edit {name}} create{Create} other{}} Dictionary" }, "add-edit-dossier-attribute": { + "error": { + "generic": "Failed to save attribute!" + }, "form": { "label": "Attribute Name", "label-placeholder": "Enter Name", @@ -71,10 +63,7 @@ "type": "Attribute Type" }, "save": "Save Attribute", - "title": "{type, select, edit{Edit {name}} create{Add New} other{}} Dossier Attribute", - "error": { - "generic": "Failed to save attribute!" - } + "title": "{type, select, edit{Edit {name}} create{Add New} other{}} Dossier Attribute" }, "add-edit-dossier-template": { "form": { @@ -112,8 +101,8 @@ "email": "Email", "first-name": "First Name", "last-name": "Last Name", - "role": "Role", - "reset-password": "Reset Password" + "reset-password": "Reset Password", + "role": "Role" }, "title": "{type, select, edit{Edit} create{Add New} other{}} User" }, @@ -168,10 +157,6 @@ "error": "Failed to save redaction: {error}", "success": "Redaction added!" }, - "force-redaction": { - "error": "Failed to save redaction: {error}", - "success": "Redaction added!" - }, "approve": { "error": "Failed to approve suggestion: {error}", "success": "Suggestion approved." @@ -184,14 +169,22 @@ "error": "Failed to decline suggestion: {error}", "success": "Suggestion declined." }, - "request-change-legal-basis": { - "error": "Failed to request annotation reason change: {error}", - "success": "Annotation reason change requested." + "force-redaction": { + "error": "Failed to save redaction: {error}", + "success": "Redaction added!" }, "recategorize-image": { "error": "Failed to recategorize image: {error}", "success": "Image recategorized." }, + "request-change-legal-basis": { + "error": "Failed to request annotation reason change: {error}", + "success": "Annotation reason change requested." + }, + "request-force-redaction": { + "error": "Failed to save redaction suggestion: {error}", + "success": "Redaction suggestion saved" + }, "request-image-recategorization": { "error": "Failed to request image recategorization: {error}", "success": "Image recategorization requested." @@ -201,10 +194,6 @@ "error": "Failed to save redaction suggestion: {error}", "success": "Redaction suggestion saved" }, - "request-force-redaction": { - "error": "Failed to save redaction suggestion: {error}", - "success": "Redaction suggestion saved" - }, "undo": { "error": "Failed to undo: {error}", "success": "Undo successful" @@ -238,13 +227,14 @@ "suggestion-add": "Suggested redaction", "suggestion-add-dictionary": "Suggested dictionary add", "suggestion-change-legal-basis": "Suggested change legal basis", - "suggestion-recategorize-image": "Suggested recategorize image", "suggestion-force-redaction": "Suggestion force redaction", + "suggestion-recategorize-image": "Suggested recategorize image", "suggestion-remove": "Suggested redaction removal", "suggestion-remove-dictionary": "Suggested dictionary removal" }, "annotations": "Annotations", "app-name": "DDA-R", + "APPROVED": "Approved", "archived": "Archived", "assign-approver-owner": { "dialog": { @@ -285,17 +275,17 @@ "all-users": "All Users", "categories": { "all-categories": "All Categories", - "license": "License", - "download": "Download", - "audit-log": "Audit Log", - "project": "Project", - "dossier": "Dossier", - "dictionary": "Dictionary", - "project-template": "Project Template", - "user": "User", - "document": "Document", "audit": "Audit", - "dossier-template": "Dossier Template" + "audit-log": "Audit Log", + "dictionary": "Dictionary", + "document": "Document", + "dossier": "Dossier", + "dossier-template": "Dossier Template", + "download": "Download", + "license": "License", + "project": "Project", + "project-template": "Project Template", + "user": "User" }, "no-data": { "title": "No available logs." @@ -521,9 +511,9 @@ }, "dossier-attribute-types": { "date": "Date", + "image": "Image", "number": "Number", - "text": "Free Text", - "image": "Image" + "text": "Free Text" }, "dossier-attributes": "Dossier Attributes", "dossier-attributes-listing": { @@ -535,13 +525,13 @@ "bulk": { "delete": "Delete Selected Attributes" }, - "no-match": { - "title": "No attributes match your current filters." - }, "no-data": { "action": "New Attribute", "title": "There are no dossier attributes." }, + "no-match": { + "title": "No attributes match your current filters." + }, "search": "Search...", "table-col-names": { "label": "Label", @@ -634,8 +624,8 @@ }, "dossier-details": { "attributes": { - "image-uploaded": "Image uploaded", "expand": "{count} custom attributes", + "image-uploaded": "Image uploaded", "show-less": "show less" }, "charts": { @@ -781,6 +771,14 @@ "revert": "Revert", "save": "Save Changes" }, + "attributes": { + "custom-attributes": "Custom Dossier Attributes", + "delete-image": "Delete Image", + "image-attributes": "Image Attributes", + "no-custom-attributes": "There are no text attributes", + "no-image-attributes": "There are no image attributes", + "upload-image": "Upload Image" + }, "change-successful": "Dossier was updated.", "delete-successful": "Dossier was deleted.", "dictionary": { @@ -814,17 +812,11 @@ "report-attributes": "Report Attributes", "team-members": "Team Members" }, - "attributes": { - "custom-attributes": "Custom Dossier Attributes", - "image-attributes": "Image Attributes", - "upload-image": "Upload Image", - "delete-image": "Delete Image", - "no-custom-attributes": "There are no text attributes", - "no-image-attributes": "There are no image attributes" - }, "unsaved-changes": "You have unsaved changes. Save or revert before changing the tab." }, "efsa": "EFSA Approval", + "ERROR": "Re-processing required", + "EXCLUDED": "Excluded", "file-attribute-types": { "date": "Date", "number": "Number", @@ -950,10 +942,10 @@ "jump-to-next": "Jump to Next", "jump-to-previous": "Jump to Previous", "label": "Workload", + "page-is": "This page is", "select": "Select", "select-all": "All", - "select-none": "None", - "page-is": "This page is" + "select-none": "None" }, "document-info": { "close": "Close Document Info", @@ -1011,6 +1003,7 @@ "status": "Status" }, "finished": "Finished", + "FULLREPROCESS": "Processing", "hint": "Hint", "initials-avatar": { "unassigned": "Unassigned", @@ -1087,6 +1080,7 @@ "tomorrow": "Tomorrow", "yesterday": "Yesterday" }, + "OCR_PROCESSING": "OCR Processing", "overwrite-files-dialog": { "options": { "cancel": "Cancel all uploads", @@ -1111,6 +1105,7 @@ }, "pending-analysis": "Pending Re-Analysis", "pending-changes-guard": "WARNING: You have unsaved changes. Press Cancel to go back and save these changes, or OK to lose these changes.", + "PROCESSING": "Processing", "readonly": "Read only", "recategorize-image-dialog": { "actions": { @@ -1124,10 +1119,10 @@ }, "header": "Edit Image Type", "options": { + "formula": "Formula", "image": "Image", "logo": "Logo", - "signature": "Signature", - "formula": "Formula" + "signature": "Signature" } }, "redaction": "Redaction", @@ -1162,16 +1157,17 @@ "title": "Reports", "upload-document": "Upload a Document" }, + "REPROCESS": "Processing", "reset-filters": "Reset Filters", "reset-password-dialog": { - "header": "Set Temporary Password for {userName}", + "actions": { + "cancel": "Cancel", + "save": "Save" + }, "form": { "password": "Temporary password" }, - "actions": { - "save": "Save", - "cancel": "Cancel" - } + "header": "Set Temporary Password for {userName}" }, "roles": { "inactive": "Inactive", @@ -1259,66 +1255,13 @@ "submitted": "Submitted", "suggestion": "Suggestion for redaction", "time": { - "no-time-left": "Time to restore already passed", - "less-than-an-hour": "< 1 hour", + "day": "day", + "days": "days", "hour": "hour", "hours": "hours", - "day": "day", - "days": "days" + "less-than-an-hour": "< 1 hour", + "no-time-left": "Time to restore already passed" }, - "top-bar": { - "navigation-items": { - "back": "Back", - "dossiers": "Active Dossier", - "my-account": { - "children": { - "admin": "Settings", - "downloads": "My Downloads", - "my-profile": "My Profile", - "trash": "Trash", - "logout": "Logout" - } - } - } - }, - "trash": { - "label": "Trash", - "table-header": { - "title": "{length} deleted dossiers", - "info": "Deleted items can be restored up to {hours} hours from their deletions" - }, - "bulk": { - "delete": "Forever Delete Selected Dossiers", - "restore": "Restore Selected Dossiers" - }, - "action": { - "delete": "Delete forever", - "restore": "Restore" - }, - "search": "Search...", - "table-col-names": { - "name": "Name", - "owner": "Owner", - "deleted-on": "Deleted on", - "time-to-restore": "Time to restore" - }, - "no-data": { - "title": "There are no dossiers yet." - }, - "no-match": { - "title": "No dossiers match your current filters." - } - }, - "sorting": { - "alphabetically": "Alphabetically", - "custom": "Custom", - "number-of-analyses": "Number of analyses", - "number-of-pages": "Number of pages", - "oldest": "Oldest", - "recent": "Recent" - }, - "submitted": "Submitted", - "suggestion": "Suggestion for redaction", "top-bar": { "navigation-items": { "back": "Back", @@ -1332,14 +1275,46 @@ "en": "English", "label": "Language" }, + "logout": "Logout", "my-profile": "My Profile", - "trash": "Trash", - "logout": "Logout" + "trash": "Trash" } } } }, + "trash": { + "action": { + "delete": "Delete forever", + "restore": "Restore" + }, + "bulk": { + "delete": "Forever Delete Selected Dossiers", + "restore": "Restore Selected Dossiers" + }, + "label": "Trash", + "no-data": { + "title": "There are no dossiers yet." + }, + "no-match": { + "title": "No dossiers match your current filters." + }, + "search": "Search...", + "table-col-names": { + "deleted-on": "Deleted on", + "name": "Name", + "owner": "Owner", + "time-to-restore": "Time to restore" + }, + "table-header": { + "info": "Deleted items can be restored up to {hours} hours from their deletions", + "title": "{length} deleted dossiers" + } + }, "type": "Type", + "UNASSIGNED": "Unassigned", + "UNDER_APPROVAL": "Under Approval", + "UNDER_REVIEW": "Under Review", + "UNPROCESSED": "Unprocessed", "upload-status": { "dialog": { "actions": { @@ -1380,8 +1355,8 @@ "user-management": "User Management", "user-profile": { "actions": { - "save": "Save profile", - "change-password": "Change Password" + "change-password": "Change Password", + "save": "Save profile" }, "form": { "email": "Email", diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 251a6705b..34854b952 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -47,7 +47,8 @@ "rank-placeholder": "", "redaction": "" }, - "save": "" + "save": "", + "title": "" }, "add-edit-dossier-attribute": { "form": { @@ -57,10 +58,7 @@ "type": "" }, "save": "", - "title": { - "edit": "", - "new": "" - } + "title": "" }, "add-edit-dossier-template": { "form": { @@ -72,10 +70,7 @@ "valid-to": "" }, "save": "", - "title": { - "edit": "", - "new": "" - } + "title": "" }, "add-edit-file-attribute": { "form": { @@ -88,10 +83,7 @@ "type": "" }, "save": "", - "title": { - "edit": "", - "new": "" - } + "title": "" }, "add-edit-user": { "actions": { @@ -107,10 +99,7 @@ "reset-password": "", "role": "" }, - "title": { - "edit": "", - "new": "" - } + "title": "" }, "annotation": "", "annotation-actions": { @@ -137,6 +126,25 @@ "show": "", "undo": "" }, + "annotation-type": { + "add-dictionary": "", + "change-legal-basis": "", + "declined-suggestion": "", + "hint": "", + "manual-redaction": "", + "pending-analysis": "", + "recommendation": "", + "redaction": "", + "remove-dictionary": "", + "remove-only-here": "", + "skipped": "", + "suggestion-add": "", + "suggestion-add-dictionary": "", + "suggestion-change-legal-basis": "", + "suggestion-force-redaction": "", + "suggestion-recategorize-image": "", + "suggestion-remove": "" + }, "annotations": "", "assign-": "", "assign-dossier-owner": { @@ -207,6 +215,7 @@ }, "comments": { "add-comment": "", + "comments": "", "hide-comments": "" }, "common": { @@ -986,6 +995,7 @@ "subtitle": "", "title": "" }, + "suggestion-remove-dictionary": "", "top-bar": { "navigation-items": { "back": "", From 486313d00a013f048c6a43d20bbc62ccabb84d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 21 Jul 2021 18:47:09 +0300 Subject: [PATCH 17/25] Translation rework: annotation action messages --- .../models/annotation-action-mode.model.ts | 14 +++ .../file-preview-screen.component.ts | 14 +-- .../services/manual-annotation.service.ts | 44 +++------- .../annotation-actions-translations.ts | 86 +++++++++++++++++++ apps/red-ui/src/assets/i18n/te.json | 81 ++++++++++++++++- 5 files changed, 203 insertions(+), 36 deletions(-) create mode 100644 apps/red-ui/src/app/modules/dossier/models/annotation-action-mode.model.ts create mode 100644 apps/red-ui/src/app/modules/dossier/translations/annotation-actions-translations.ts diff --git a/apps/red-ui/src/app/modules/dossier/models/annotation-action-mode.model.ts b/apps/red-ui/src/app/modules/dossier/models/annotation-action-mode.model.ts new file mode 100644 index 000000000..eabbda0a9 --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/models/annotation-action-mode.model.ts @@ -0,0 +1,14 @@ +export type AnnotationActionMode = + | 'add' + | 'approve' + | 'remove' + | 'change-legal-basis' + | 'decline' + | 'request-remove' + | 'request-change-legal-basis' + | 'recategorize-image' + | 'request-image-recategorization' + | 'suggest' + | 'undo' + | 'force-redaction' + | 'request-force-redaction'; 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 8acbcbf0d..f55db541e 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 @@ -120,11 +120,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme } get activeViewerPage() { + const currentPage = this._instance?.docViewer?.getCurrentPage(); + if (!currentPage) { + return 0; + } return this.viewerComponent?.viewMode === 'STANDARD' - ? this._instance?.docViewer?.getCurrentPage() - : this._instance?.docViewer?.getCurrentPage() % 2 === 0 - ? this._instance?.docViewer?.getCurrentPage() / 2 - : (this._instance?.docViewer?.getCurrentPage() + 1) / 2; + ? currentPage + : currentPage % 2 === 0 + ? currentPage / 2 + : (currentPage + 1) / 2; } get canSwitchToRedactedView() { @@ -410,7 +414,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme } async annotationsChangedByReviewAction(annotation: AnnotationWrapper) { - await this._cleanupAndRedrawManualAnnotationsForEntirePage(annotation.pageNumber); + await this._cleanupAndRedrawManualAnnotationsForEntirePage(annotation?.pageNumber || this.activeViewerPage); } async fileActionPerformed(action: string) { 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 4de092d50..a15210aab 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 @@ -12,26 +12,13 @@ import { TranslateService } from '@ngx-translate/core'; import { tap } from 'rxjs/operators'; import { UserService } from '@services/user.service'; import { PermissionsService } from '@services/permissions.service'; - -type Mode = - | 'add' - | 'approve' - | 'remove' - | 'change-legal-basis' - | 'decline' - | 'request-remove' - | 'request-change-legal-basis' - | 'recategorize-image' - | 'request-image-recategorization' - | 'suggest' - | 'undo' - | 'force-redaction' - | 'request-force-redaction'; +import { AnnotationActionMode } from '../models/annotation-action-mode.model'; +import { annotationActionsTranslations } from '../translations/annotation-actions-translations'; @Injectable() export class ManualAnnotationService { CONFIG: { - [key in Mode]: string; + [key in AnnotationActionMode]: string; }; constructor( @@ -60,7 +47,7 @@ export class ManualAnnotationService { }; } - _makeRequest(mode: Mode, body: any, secondParam: any = null, modifyDictionary = false) { + _makeRequest(mode: AnnotationActionMode, body: any, secondParam: any = null, modifyDictionary = false) { const obs = !secondParam ? this._manualRedactionControllerService[this.CONFIG[mode]]( body, @@ -123,7 +110,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/legalBasisChange // /manualRedaction/request/legalBasis changeLegalBasis(annotationId: string, legalBasis: string, comment?: string) { - const mode: Mode = this._permissionsService.isApprover() ? 'change-legal-basis' : 'request-change-legal-basis'; + const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'change-legal-basis' : 'request-change-legal-basis'; return this._makeRequest(mode, { annotationId, legalBasis, comment }); } @@ -131,7 +118,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/recategorize // /manualRedaction/request/recategorize recategorizeImage(annotationId: string, type: string, comment: string) { - const mode: Mode = this._permissionsService.isApprover() ? 'recategorize-image' : 'request-image-recategorization'; + const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'recategorize-image' : 'request-image-recategorization'; return this._makeRequest(mode, { annotationId, type, comment }); } @@ -139,7 +126,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/add // /manualRedaction/request/add addAnnotation(manualRedactionEntry: AddRedactionRequest) { - const mode: Mode = this._permissionsService.isApprover() ? 'add' : 'suggest'; + const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'add' : 'suggest'; return this._makeRequest(mode, manualRedactionEntry, null, manualRedactionEntry.addToDictionary); } @@ -147,7 +134,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/force // /manualRedaction/request/force forceRedaction(request: ForceRedactionRequest) { - const mode: Mode = this._permissionsService.isApprover() ? 'force-redaction' : 'request-force-redaction'; + const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'force-redaction' : 'request-force-redaction'; return this._makeRequest(mode, request); } @@ -166,7 +153,7 @@ export class ManualAnnotationService { // /manualRedaction/decline/remove // /manualRedaction/undo declineOrRemoveRequest(annotationWrapper: AnnotationWrapper) { - const mode: Mode = this._permissionsService.isApprover() ? 'decline' : 'undo'; + const mode: AnnotationActionMode = this._permissionsService.isApprover() ? 'decline' : 'undo'; return this._makeRequest(mode, annotationWrapper.id, null, annotationWrapper.isModifyDictionary); } @@ -174,7 +161,7 @@ export class ManualAnnotationService { // /manualRedaction/redaction/remove/ // /manualRedaction/request/remove/ removeOrSuggestRemoveAnnotation(annotationWrapper: AnnotationWrapper, removeFromDictionary: boolean = false) { - let mode: Mode, + let mode: AnnotationActionMode, body: any, removeDict = false; @@ -227,12 +214,9 @@ export class ManualAnnotationService { } } - private _getMessage(mode: Mode, modifyDictionary?: boolean, error: boolean = false) { - return ( - 'annotation-actions.message.' + - (modifyDictionary ? 'dictionary.' : 'manual-redaction.') + - mode + - (error ? '.error' : '.success') - ); + private _getMessage(mode: AnnotationActionMode, modifyDictionary?: boolean, error: boolean = false) { + const type = modifyDictionary ? 'dictionary' : 'manual-redaction'; + const resultType = error ? 'error' : 'success'; + return annotationActionsTranslations[type][mode][resultType]; } } diff --git a/apps/red-ui/src/app/modules/dossier/translations/annotation-actions-translations.ts b/apps/red-ui/src/app/modules/dossier/translations/annotation-actions-translations.ts new file mode 100644 index 000000000..2679a24ad --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/translations/annotation-actions-translations.ts @@ -0,0 +1,86 @@ +import { AnnotationActionMode } from '../models/annotation-action-mode.model'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +type ActionType = { [key in AnnotationActionMode]?: { error: string; success: string } }; + +export const annotationActionsTranslations: { + dictionary: ActionType; + 'manual-redaction': ActionType; +} = { + dictionary: { + add: { + error: _('annotation-actions.message.dictionary.add.error'), + success: _('annotation-actions.message.dictionary.add.success') + }, + approve: { + error: _('annotation-actions.message.dictionary.approve.error'), + success: _('annotation-actions.message.dictionary.approve.success') + }, + decline: { + error: _('annotation-actions.message.dictionary.decline.error'), + success: _('annotation-actions.message.dictionary.decline.success') + }, + remove: { + error: _('annotation-actions.message.dictionary.remove.error'), + success: _('annotation-actions.message.dictionary.remove.success') + }, + 'request-remove': { + error: _('annotation-actions.message.dictionary.request-remove.error'), + success: _('annotation-actions.message.dictionary.request-remove.success') + }, + suggest: { + error: _('annotation-actions.message.dictionary.suggest.error'), + success: _('annotation-actions.message.dictionary.suggest.success') + }, + undo: { + error: _('annotation-actions.message.dictionary.undo.error'), + success: _('annotation-actions.message.dictionary.undo.success') + } + }, + 'manual-redaction': { + add: { + error: _('annotation-actions.message.manual-redaction.add.error'), + success: _('annotation-actions.message.manual-redaction.add.success') + }, + approve: { + error: _('annotation-actions.message.manual-redaction.approve.error'), + success: _('annotation-actions.message.manual-redaction.approve.success') + }, + 'change-legal-basis': { + error: _('annotation-actions.message.manual-redaction.change-legal-basis.error'), + success: _('annotation-actions.message.manual-redaction.change-legal-basis.success') + }, + decline: { + error: _('annotation-actions.message.manual-redaction.decline.error'), + success: _('annotation-actions.message.manual-redaction.decline.success') + }, + 'force-redaction': { + error: _('annotation-actions.message.manual-redaction.force-redaction.error'), + success: _('annotation-actions.message.manual-redaction.force-redaction.success') + }, + 'recategorize-image': { + error: _('annotation-actions.message.manual-redaction.recategorize-image.error'), + success: _('annotation-actions.message.manual-redaction.recategorize-image.success') + }, + 'request-change-legal-basis': { + error: _('annotation-actions.message.manual-redaction.request-change-legal-basis.error'), + success: _('annotation-actions.message.manual-redaction.request-change-legal-basis.success') + }, + 'request-force-redaction': { + error: _('annotation-actions.message.manual-redaction.request-force-redaction.error'), + success: _('annotation-actions.message.manual-redaction.request-force-redaction.success') + }, + 'request-image-recategorization': { + error: _('annotation-actions.message.manual-redaction.request-image-recategorization.error'), + success: _('annotation-actions.message.manual-redaction.request-image-recategorization.success') + }, + suggest: { + error: _('annotation-actions.message.manual-redaction.suggest.error'), + success: _('annotation-actions.message.manual-redaction.suggest.success') + }, + undo: { + error: _('annotation-actions.message.manual-redaction.undo.error'), + success: _('annotation-actions.message.manual-redaction.undo.success') + } + } +}; diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 34854b952..9726570cc 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -116,6 +116,84 @@ "label": "" }, "hide": "", + "message": { + "dictionary": { + "add": { + "error": "", + "success": "" + }, + "approve": { + "error": "", + "success": "" + }, + "decline": { + "error": "", + "success": "" + }, + "remove": { + "error": "", + "success": "" + }, + "request-remove": { + "error": "", + "success": "" + }, + "suggest": { + "error": "", + "success": "" + }, + "undo": { + "error": "", + "success": "" + } + }, + "manual-redaction": { + "add": { + "error": "", + "success": "" + }, + "approve": { + "error": "", + "success": "" + }, + "change-legal-basis": { + "error": "", + "success": "" + }, + "decline": { + "error": "", + "success": "" + }, + "force-redaction": { + "error": "", + "success": "" + }, + "recategorize-image": { + "error": "", + "success": "" + }, + "request-change-legal-basis": { + "error": "", + "success": "" + }, + "request-force-redaction": { + "error": "", + "success": "" + }, + "request-image-recategorization": { + "error": "", + "success": "" + }, + "suggest": { + "error": "", + "success": "" + }, + "undo": { + "error": "", + "success": "" + } + } + }, "recategorize-image": "", "reject-suggestion": "", "remove-annotation": { @@ -688,7 +766,8 @@ "disable-read-only": "", "enable-read-only": "", "read-only": "", - "remove-selected": "" + "remove-selected": "", + "type": "" }, "title": "" }, From f3ebeb841aed74c48f54d04bc1ac0b68fe69e041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 22 Jul 2021 14:07:38 +0300 Subject: [PATCH 18/25] Translation rework: fixes --- .../add-edit-dictionary-dialog.component.ts | 7 ++-- ...edit-dossier-attribute-dialog.component.ts | 3 +- .../license-information-screen.component.ts | 3 +- ...gn-reviewer-approver-dialog.component.html | 14 +++++--- .../red-ui/src/app/state/app-state.service.ts | 3 +- .../annotation-types-translations.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 16 +++------- apps/red-ui/src/assets/i18n/te.json | 32 +++++++++++++------ 8 files changed, 47 insertions(+), 33 deletions(-) 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 592e389ae..75577153c 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 @@ -7,6 +7,7 @@ import { Toaster } from '@services/toaster.service'; import { TranslateService } from '@ngx-translate/core'; import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import { humanize } from '../../../../utils/functions'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-add-edit-dictionary-dialog', @@ -89,11 +90,11 @@ export class AddEditDictionaryDialogComponent { () => this._dialogRef.close(true), error => { if (error.status === 409) { - this._toaster.error('add-edit-dictionary.error.dictionary-already-exists'); + this._toaster.error(_('add-edit-dictionary.error.dictionary-already-exists')); } else if (error.status === 400) { - this._toaster.error('add-edit-dictionary.error.invalid-color-or-rank'); + this._toaster.error(_('add-edit-dictionary.error.invalid-color-or-rank')); } else { - this._toaster.error('add-edit-dictionary.error.generic'); + this._toaster.error(_('add-edit-dictionary.error.generic')); } } ); diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts index 5a35385c2..73a61f3a2 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component.ts @@ -9,6 +9,7 @@ import { Toaster } from '@services/toaster.service'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { dossierAttributeTypesTranslations } from '../../translations/dossier-attribute-types-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-add-edit-dossier-attribute-dialog', @@ -80,7 +81,7 @@ export class AddEditDossierAttributeDialogComponent extends AutoUnsubscribeCompo }, (error: HttpErrorResponse) => { this._loadingService.stop(); - this._toaster.error('add-edit-dossier-attribute.error.generic', { error: error }); + this._toaster.error(_('add-edit-dossier-attribute.error.generic'), { error: error }); } ); } 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 4b7b7d12d..a9f9c95fa 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 @@ -93,6 +93,7 @@ export class LicenseInformationScreenComponent implements OnInit { const subject = this._translateService.instant('license-info-screen.email.title', { licenseCustomer }); + const lineBreak = '%0D%0A'; const body = [ this._translateService.instant('license-info-screen.email.body.analyzed', { pages: this.currentInfo.numberOfAnalyzedPages @@ -100,7 +101,7 @@ export class LicenseInformationScreenComponent implements OnInit { this._translateService.instant('license-info-screen.email.body.licensed', { pages: this.totalLicensedNumberOfPages }) - ].join('%0D%0A'); + ].join(lineBreak); window.location.href = `mailto:${this.appConfigService.getConfig('LICENSE_EMAIL')}?subject=${subject}&body=${body}`; } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.html index 86e23df90..0f73f7b3a 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/assign-reviewer-approver-dialog/assign-reviewer-approver-dialog.component.html @@ -1,11 +1,17 @@
-
+
- {{ 'assign-' + data.mode + '-owner.dialog.single-user' | translate }} + {{ 'assign-owner.dialog.label' | translate: { type: data.mode } }} {{ userService.getNameForId(userId) }} @@ -17,10 +23,10 @@
-
+
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 22486ceb1..fa2139c6b 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -21,6 +21,7 @@ import { DossierWrapper } from './model/dossier.wrapper'; import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import { DossierTemplateModelWrapper } from '@models/file/dossier-template-model.wrapper'; import { DossiersService } from '../modules/dossier/services/dossiers.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export interface AppState { dossiers: DossierWrapper[]; @@ -348,7 +349,7 @@ export class AppStateService { return foundDossier; } catch (error) { this._toaster.error( - error.status === 409 ? 'add-dossier-dialog.errors.dossier-already-exists' : 'add-dossier-dialog.errors.generic' + error.status === 409 ? _('add-dossier-dialog.errors.dossier-already-exists') : _('add-dossier-dialog.errors.generic') ); } } diff --git a/apps/red-ui/src/app/translations/annotation-types-translations.ts b/apps/red-ui/src/app/translations/annotation-types-translations.ts index e1917b831..08c363279 100644 --- a/apps/red-ui/src/app/translations/annotation-types-translations.ts +++ b/apps/red-ui/src/app/translations/annotation-types-translations.ts @@ -19,5 +19,5 @@ export const annotationTypesTranslations: { [key in AnnotationSuperType]: string 'suggestion-recategorize-image': _('annotation-type.suggestion-recategorize-image'), 'suggestion-force-redaction': _('annotation-type.suggestion-force-redaction'), 'suggestion-remove': _('annotation-type.suggestion-remove'), - 'suggestion-remove-dictionary': _('suggestion-remove-dictionary') + 'suggestion-remove-dictionary': _('annotation-type.suggestion-remove-dictionary') }; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 4987f501d..3319b987e 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -112,7 +112,7 @@ "label": "Accept Recommendation" }, "accept-suggestion": { - "add-to-dict": "Approve and add to dictionary" + "label": "Approve and add to dictionary" }, "edit-reason": { "label": "Edit Reason" @@ -236,14 +236,6 @@ "app-name": "DDA-R", "APPROVED": "Approved", "archived": "Archived", - "assign-approver-owner": { - "dialog": { - "cancel": "Cancel", - "save": "Save", - "single-user": "Approver", - "title": "Manage File Approver" - } - }, "assign-dossier-owner": { "dialog": { "approvers": "Approvers", @@ -258,12 +250,12 @@ "title": "Manage Dossier Team" } }, - "assign-reviewer-owner": { + "assign-owner": { "dialog": { "cancel": "Cancel", + "label": "{type, select, approver{Approver} reviewer{Reviewer} other{}}", "save": "Save", - "single-user": "Reviewer", - "title": "Manage File Reviewer" + "title": "Manage File {type, select, approver{Approver} reviewer{Reviewer} other{}}" } }, "assign-user": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index 9726570cc..b9cbf4cad 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -1,12 +1,5 @@ { - "%0D%0A": "", ", ": "", - "-owner": { - "dialog": { - "cancel": "", - "title": "" - } - }, "actions": { "all": "", "none": "" @@ -16,6 +9,10 @@ "save": "", "save-and-add-members": "" }, + "errors": { + "dossier-already-exists": "", + "generic": "" + }, "form": { "description": { "label": "", @@ -32,6 +29,11 @@ "header-new": "" }, "add-edit-dictionary": { + "error": { + "dictionary-already-exists": "", + "generic": "", + "invalid-color-or-rank": "" + }, "form": { "add-to-dictionary-action": "", "case-sensitive": "", @@ -51,6 +53,9 @@ "title": "" }, "add-edit-dossier-attribute": { + "error": { + "generic": "" + }, "form": { "label": "", "label-placeholder": "", @@ -221,10 +226,10 @@ "suggestion-change-legal-basis": "", "suggestion-force-redaction": "", "suggestion-recategorize-image": "", - "suggestion-remove": "" + "suggestion-remove": "", + "suggestion-remove-dictionary": "" }, "annotations": "", - "assign-": "", "assign-dossier-owner": { "dialog": { "approvers": "", @@ -236,6 +241,14 @@ "single-user": "" } }, + "assign-owner": { + "dialog": { + "cancel": "", + "label": "", + "save": "", + "title": "" + } + }, "assign-user": { "cancel": "", "save": "" @@ -1074,7 +1087,6 @@ "subtitle": "", "title": "" }, - "suggestion-remove-dictionary": "", "top-bar": { "navigation-items": { "back": "", From 297f55493c1ae78b86e5cab6f2757f9028d5839b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 22 Jul 2021 14:47:56 +0300 Subject: [PATCH 19/25] Translation rework: fixes --- .../base-screen/base-screen.component.ts | 9 ++-- .../admin-side-nav.component.html | 2 +- .../admin-side-nav.component.ts | 29 ++++++------ .../users-stats/users-stats.component.html | 2 +- .../dictionary-listing-screen.component.html | 2 +- .../watermark/watermark-screen.component.ts | 7 ++- .../dossier-details.component.html | 2 +- .../dossier-listing-details.component.html | 4 +- .../dossier-listing-screen.component.ts | 3 +- .../dossier-overview-screen.component.ts | 3 +- .../translations/workload-translations.ts | 11 +++++ .../simple-doughnut-chart.component.html | 2 +- .../src/app/modules/shared/pipes/date.pipe.ts | 14 ++---- .../app/utils/missing-translations-handler.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 14 +----- apps/red-ui/src/assets/i18n/te.json | 44 ++++++++++++++++++- 16 files changed, 96 insertions(+), 54 deletions(-) create mode 100644 apps/red-ui/src/app/modules/dossier/translations/workload-translations.ts diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index bb3359453..e5b07abdc 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -7,6 +7,7 @@ import { Router } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { FileDownloadService } from '@upload-download/services/file-download.service'; import { TranslateService } from '@ngx-translate/core'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; interface MenuItem { name: string; @@ -22,23 +23,23 @@ interface MenuItem { export class BaseScreenComponent { readonly userMenuItems: MenuItem[] = [ { - name: 'top-bar.navigation-items.my-account.children.my-profile', + name: _('top-bar.navigation-items.my-account.children.my-profile'), routerLink: '/main/my-profile', show: true }, { - name: 'top-bar.navigation-items.my-account.children.admin', + name: _('top-bar.navigation-items.my-account.children.admin'), routerLink: '/main/admin', show: this.permissionsService.isManager() || this.permissionsService.isUserAdmin(), action: this.appStateService.reset }, { - name: 'top-bar.navigation-items.my-account.children.downloads', + name: _('top-bar.navigation-items.my-account.children.downloads'), routerLink: '/main/downloads', show: this.permissionsService.isUser() }, { - name: 'top-bar.navigation-items.my-account.children.trash', + name: _('top-bar.navigation-items.my-account.children.trash'), routerLink: '/main/admin/trash', show: this.permissionsService.isManager() || this.permissionsService.isUserAdmin() } diff --git a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html index a4d370d76..65bbc2a89 100644 --- a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html +++ b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html @@ -12,7 +12,7 @@ class="item" routerLinkActive="active" > - {{ item.label || item.screen | translate }} + {{ item.label | translate }}
diff --git a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts index 13dbb85c0..418fb71b4 100644 --- a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts +++ b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.ts @@ -2,6 +2,7 @@ import { Component, Input } from '@angular/core'; import { PermissionsService } from '@services/permissions.service'; import { UserPreferenceService } from '@services/user-preference.service'; import { AppStateService } from '@state/app-state.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-admin-side-nav', @@ -18,25 +19,25 @@ export class AdminSideNavComponent { onlyAdmin?: boolean; onlyManager?: boolean; userManagerOnly?: boolean; - label?: string; + label: string; }[]; } = { settings: [ - { screen: 'dossier-templates', onlyManager: true }, - { screen: 'digital-signature', onlyAdmin: true }, - { screen: 'license-info', label: 'license-information', onlyAdmin: true }, - { screen: 'audit', onlyAdmin: true }, - { screen: 'users', label: 'user-management', userManagerOnly: true }, - { screen: 'smtp-config', label: 'configurations', onlyAdmin: true } + { screen: 'dossier-templates', label: _('dossier-templates'), onlyManager: true }, + { screen: 'digital-signature', label: _('digital-signature'), onlyAdmin: true }, + { screen: 'license-info', label: _('license-information'), onlyAdmin: true }, + { screen: 'audit', label: _('audit'), onlyAdmin: true }, + { screen: 'users', label: _('user-management'), userManagerOnly: true }, + { screen: 'smtp-config', label: _('configurations'), onlyAdmin: true } ], 'dossier-templates': [ - { screen: 'dictionaries' }, - { screen: 'rules', onlyDevMode: true, label: 'rule-editor' }, - { screen: 'default-colors' }, - { screen: 'watermark' }, - { screen: 'file-attributes' }, - { screen: 'dossier-attributes' }, - { screen: 'reports', onlyDevMode: true } + { screen: 'dictionaries', label: _('dictionaries') }, + { screen: 'rules', onlyDevMode: true, label: _('rule-editor') }, + { screen: 'default-colors', label: _('default-colors') }, + { screen: 'watermark', label: _('watermark') }, + { screen: 'file-attributes', label: _('file-attributes') }, + { screen: 'dossier-attributes', label: _('dossier-attributes') }, + { screen: 'reports', label: _('reports'), onlyDevMode: true } ] }; diff --git a/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html b/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html index d3e45d454..88d0709fb 100644 --- a/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html +++ b/apps/red-ui/src/app/modules/admin/components/users-stats/users-stats.component.html @@ -23,7 +23,7 @@ [config]="chartData" [radius]="63" [strokeWidth]="15" - [subtitle]="'user-stats.chart.users'" + [subtitle]="'user-stats.chart.users' | translate" direction="row" totalType="sum" > diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index b33a0b768..b921d38b3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -163,7 +163,7 @@ [counterText]="'dictionary-listing.stats.charts.entries' | translate" [radius]="82" [strokeWidth]="15" - [subtitle]="'dictionary-listing.stats.charts.types'" + [subtitle]="'dictionary-listing.stats.charts.types' | translate" totalType="count" >
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 ac29cfe69..21dd63d9b 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 @@ -11,6 +11,7 @@ import { Toaster } from '@services/toaster.service'; import { ActivatedRoute } from '@angular/router'; import { BASE_HREF } from '../../../../tokens'; import { stampPDFPage } from '../../../../utils/page-stamper'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export const DEFAULT_WATERMARK: WatermarkModelRes = { text: null, @@ -82,9 +83,11 @@ export class WatermarkScreenComponent implements OnInit { observable.toPromise().then( () => { this._loadWatermark(); - this._toaster.success(watermark.text ? 'watermark-screen.action.change-success' : 'watermark-screen.action.delete-success'); + this._toaster.success( + watermark.text ? _('watermark-screen.action.change-success') : _('watermark-screen.action.delete-success') + ); }, - () => this._toaster.error('watermark-screen.action.error') + () => this._toaster.error(_('watermark-screen.action.error')) ); } 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 89394475d..c5a606aa3 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 @@ -45,7 +45,7 @@ [config]="documentsChartData" [radius]="63" [strokeWidth]="15" - [subtitle]="'dossier-overview.dossier-details.charts.documents-in-dossier'" + [subtitle]="'dossier-overview.dossier-details.charts.documents-in-dossier' | translate" direction="row" >
diff --git a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.html b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.html index 6609a95ad..48847222d 100644 --- a/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/dossier-listing-details/dossier-listing-details.component.html @@ -3,7 +3,7 @@ [config]="dossiersChartData" [radius]="80" [strokeWidth]="15" - [subtitle]="'dossier-listing.stats.charts.dossiers'" + [subtitle]="'dossier-listing.stats.charts.dossiers' | translate" >
@@ -29,6 +29,6 @@ [config]="documentsChartData" [radius]="80" [strokeWidth]="15" - [subtitle]="'dossier-listing.stats.charts.total-documents'" + [subtitle]="'dossier-listing.stats.charts.total-documents' | translate" >
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 bef95068a..ea86e2e36 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 @@ -29,6 +29,7 @@ import { ScreenStateService } from '@shared/services/screen-state.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; import { SortingService } from '@services/sorting.service'; import { TableColConfig } from '@shared/components/table-col-name/table-col-name.component'; +import { workloadTranslations } from '../../translations/workload-translations'; const isLeavingScreen = event => event instanceof NavigationStart && event.url !== '/main/dossiers'; @@ -230,7 +231,7 @@ export class DossierListingScreenComponent const needsWorkFilters = [...allDistinctNeedsWork].map(type => ({ key: type, - label: `filter.${type}` + label: workloadTranslations[type] })); this.filterService.addFilterGroup({ 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 1c1cad6b2..f396f0f21 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 @@ -32,6 +32,7 @@ import { LoadingService } from '@services/loading.service'; import { DossierAttributesService } from '@shared/services/controller-wrappers/dossier-attributes.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { UserPreferenceService } from '@services/user-preference.service'; +import { workloadTranslations } from '../../translations/workload-translations'; @Component({ templateUrl: './dossier-overview-screen.component.html', @@ -294,7 +295,7 @@ export class DossierOverviewScreenComponent const needsWorkFilters = [...allDistinctNeedsWork].map(item => ({ key: item, - label: this._translateService.instant('filter.' + item) + label: workloadTranslations[item] })); this.filterService.addFilterGroup({ diff --git a/apps/red-ui/src/app/modules/dossier/translations/workload-translations.ts b/apps/red-ui/src/app/modules/dossier/translations/workload-translations.ts new file mode 100644 index 000000000..eea3c5668 --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/translations/workload-translations.ts @@ -0,0 +1,11 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const workloadTranslations: { [key: string]: string } = { + analysis: _('filter.analysis'), + hint: _('filter.hint'), + image: _('filter.image'), + none: _('filter.none'), + redaction: _('filter.redaction'), + suggestion: _('filter.suggestion'), + updated: _('filter.updated') +}; diff --git a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html index af8c784fc..09e4aa6af 100644 --- a/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -19,7 +19,7 @@
{{ displayedDataTotal }}
-
{{ subtitle | translate }}
+
{{ subtitle }}
diff --git a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts index fe9f71c85..6b0a34b6f 100644 --- a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts @@ -31,23 +31,17 @@ export class DatePipe extends BaseDatePipe implements PipeTransform { const minutesFromNow = date.diff(now, 'minutes'); const minutesLeft = minutesFromNow - HOURS_IN_A_DAY * MINUTES_IN_AN_HOUR * daysLeft; - if (daysLeft === 0 && hoursLeft === 0 && minutesLeft > 0) return this._translate('time.less-than-an-hour'); + if (daysLeft === 0 && hoursLeft === 0 && minutesLeft > 0) return this._translateService.instant('time.less-than-an-hour'); - const hoursSuffix = this._translate(`time.hour${hoursLeft === 1 ? '' : 's'}`); - const hoursDisplay = `${hoursLeft} ${hoursSuffix}`; + const hoursDisplay = this._translateService.instant('time.hours', { hours: hoursLeft }); if (daysLeft === 0 && hoursLeft > 0) return hoursDisplay; - const daysSuffix = this._translate(`time.day${daysLeft === 1 ? '' : 's'}`); - const daysDisplay = `${daysLeft} ${daysSuffix}`; + const daysDisplay = this._translateService.instant('time.days', { days: daysLeft }); if (daysLeft > 0 && hoursLeft > 0) return `${daysDisplay} ${hoursDisplay}`; if (daysLeft > 0) return daysDisplay; - return this._translate(`time.no-time-left`); - } - - private _translate(value: string, params?: { [key: string]: string }) { - return this._translateService.instant(value, params); + return this._translateService.instant(`time.no-time-left`); } } diff --git a/apps/red-ui/src/app/utils/missing-translations-handler.ts b/apps/red-ui/src/app/utils/missing-translations-handler.ts index b6b871c45..436d0ba02 100644 --- a/apps/red-ui/src/app/utils/missing-translations-handler.ts +++ b/apps/red-ui/src/app/utils/missing-translations-handler.ts @@ -4,6 +4,6 @@ export class REDMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams): any { const missingKey = params.key; console.error('Missing translation: ' + missingKey); - return missingKey; + return `?${missingKey}?`; } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 3319b987e..fa4c2bc2a 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1236,21 +1236,11 @@ }, "title": "Configure SMTP Account" }, - "sorting": { - "alphabetically": "Alphabetically", - "custom": "Custom", - "number-of-analyses": "Number of analyses", - "number-of-pages": "Number of pages", - "oldest": "Oldest", - "recent": "Recent" - }, "submitted": "Submitted", "suggestion": "Suggestion for redaction", "time": { - "day": "day", - "days": "days", - "hour": "hour", - "hours": "hours", + "hours": "{hours} {hours, plural, one{hour} other{hours}}", + "days": "{days} {days, plural, one{day} other{days}}", "less-than-an-hour": "< 1 hour", "no-time-left": "Time to restore already passed" }, diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index b9cbf4cad..d36837b91 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -358,6 +358,7 @@ } }, "content": "", + "default-colors": "", "default-colors-screen": { "action": { "edit": "" @@ -382,6 +383,7 @@ } }, "dev-mode": "", + "dictionaries": "", "dictionary-listing": { "action": { "delete": "", @@ -402,7 +404,8 @@ "search": "", "stats": { "charts": { - "entries": "" + "entries": "", + "types": "" } }, "table-col-names": { @@ -474,6 +477,7 @@ "number": "", "text": "" }, + "dossier-attributes": "", "dossier-attributes-listing": { "action": { "edit": "" @@ -539,6 +543,10 @@ "search": "", "stats": { "analyzed-pages": "", + "charts": { + "dossiers": "", + "total-documents": "" + }, "total-people": "" }, "table-col-names": { @@ -567,6 +575,9 @@ "image-uploaded": "", "show-less": "" }, + "charts": { + "documents-in-dossier": "" + }, "description": "", "dictionary": "", "stats": { @@ -734,6 +745,7 @@ "number": "", "text": "" }, + "file-attributes": "", "file-attributes-csv-import": { "action": { "cancel-edit-name": "", @@ -878,6 +890,15 @@ "filter-types": "", "label": "" }, + "filter": { + "analysis": "", + "hint": "", + "image": "", + "none": "", + "redaction": "", + "suggestion": "", + "updated": "" + }, "filters": { "assigned-people": "", "dossier-templates": "", @@ -1006,6 +1027,7 @@ "report-type": { "label": "" }, + "reports": "", "reports-screen": { "description": "", "document-setup-description": "", @@ -1035,6 +1057,7 @@ "red-user-admin": "", "regular": "" }, + "rule-editor": "", "rules-screen": { "revert-changes": "", "save-changes": "" @@ -1087,18 +1110,28 @@ "subtitle": "", "title": "" }, + "time": { + "days": "", + "hours": "", + "less-than-an-hour": "", + "no-time-left": "" + }, "top-bar": { "navigation-items": { "back": "", "dossiers": "", "my-account": { "children": { + "admin": "", + "downloads": "", "language": { "de": "", "en": "", "label": "" }, - "logout": "" + "logout": "", + "my-profile": "", + "trash": "" } } } @@ -1180,12 +1213,19 @@ "title": "" }, "user-stats": { + "chart": { + "users": "" + }, "collapse": "", "expand": "", "title": "" }, + "watermark": "", "watermark-screen": { "action": { + "change-success": "", + "delete-success": "", + "error": "", "revert": "", "save": "" }, From 585e2d69d490405eee4a22fe8c6bb16818933bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 22 Jul 2021 16:43:10 +0300 Subject: [PATCH 20/25] Translation rework: file status, other fixes --- .../dossier-details.component.ts | 3 +- .../dossier-listing-screen.component.ts | 10 ++++--- .../dossier-overview-screen.component.ts | 3 +- .../file-preview-screen.component.html | 2 +- .../file-preview-screen.component.ts | 3 +- .../services/dossiers-dialog.service.ts | 2 +- .../translations/file-status-translations.ts | 16 +++++++++++ .../confirmation-dialog.component.ts | 3 +- .../app/services/translate-chart.service.ts | 4 +-- apps/red-ui/src/assets/i18n/en.json | 28 +++++++++---------- apps/red-ui/src/assets/i18n/te.json | 16 +++++++++++ 11 files changed, 62 insertions(+), 28 deletions(-) create mode 100644 apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts 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 feb1885e7..c0499b196 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 @@ -10,6 +10,7 @@ import { User } from '@redaction/red-ui-http'; import { Toaster } from '@services/toaster.service'; import { FilterService } from '@shared/services/filter.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; @Component({ selector: 'redaction-dossier-details', @@ -68,7 +69,7 @@ export class DossierDetailsComponent implements OnInit { this.documentsChartData.push({ value: groups[key].length, color: key, - label: key, + label: fileStatusTranslations[key], key: key }); } 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 ea86e2e36..598936eb3 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 @@ -30,6 +30,8 @@ import { BaseListingComponent } from '@shared/base/base-listing.component'; import { SortingService } from '@services/sorting.service'; import { TableColConfig } from '@shared/components/table-col-name/table-col-name.component'; import { workloadTranslations } from '../../translations/workload-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; const isLeavingScreen = event => event instanceof NavigationStart && event.url !== '/main/dossiers'; @@ -159,8 +161,8 @@ export class DossierListingScreenComponent this._computeAllFilters(); this.dossiersChartData = [ - { value: this._activeDossiersCount, color: 'ACTIVE', label: 'active' }, - { value: this._inactiveDossiersCount, color: 'DELETED', label: 'archived' } + { value: this._activeDossiersCount, color: 'ACTIVE', label: _('active') }, + { value: this._inactiveDossiersCount, color: 'DELETED', label: _('archived') } ]; const groups = groupBy(this._appStateService.aggregatedFiles, 'status'); this.documentsChartData = []; @@ -169,7 +171,7 @@ export class DossierListingScreenComponent this.documentsChartData.push({ value: groups[key].length, color: key, - label: key, + label: fileStatusTranslations[key], key: key }); } @@ -205,7 +207,7 @@ export class DossierListingScreenComponent const statusFilters = [...allDistinctFileStatus].map(status => ({ key: status, - label: this._translateService.instant(status) + label: this._translateService.instant(fileStatusTranslations[status]) })); this.filterService.addFilterGroup({ 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 f396f0f21..2d808006d 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 @@ -33,6 +33,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { UserPreferenceService } from '@services/user-preference.service'; import { workloadTranslations } from '../../translations/workload-translations'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; @Component({ templateUrl: './dossier-overview-screen.component.html', @@ -259,7 +260,7 @@ export class DossierOverviewScreenComponent const statusFilters = [...allDistinctFileStatusWrapper].map(item => ({ key: item, - label: this._translateService.instant(item) + label: this._translateService.instant(fileStatusTranslations[item]) })); this.filterService.addFilterGroup({ 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 91535d836..0e11c468e 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 @@ -35,7 +35,7 @@
- {{ status | translate }} + {{ translations[status] | translate }} {{ 'by' | translate }}:
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 f55db541e..fb6ee69f3 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 @@ -37,6 +37,7 @@ import { LoadingService } from '@services/loading.service'; import { stampPDFPage } from '../../../../utils/page-stamper'; import { TranslateService } from '@ngx-translate/core'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; @@ -64,10 +65,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribeComponent impleme viewDocumentInfo = false; excludePages = false; @ViewChild(PdfViewerComponent) viewerComponent: PdfViewerComponent; + translations = fileStatusTranslations; private _instance: WebViewerInstance; private _lastPage: string; private _reloadFileOnReanalysis = false; - @ViewChild('fileWorkloadComponent') private _workloadComponent: FileWorkloadComponent; constructor( 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 becdd9247..c4fff7ae9 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 @@ -205,7 +205,7 @@ export class DossiersDialogService extends DialogService { title: _('confirmation-dialog.delete-dossier.title'), titleColor: TitleColors.PRIMARY, question: _('confirmation-dialog.delete-dossier.question'), - // details: _('confirmation-dialog.delete-dossier.details'), + details: _('confirmation-dialog.delete-dossier.details'), confirmationText: _('confirmation-dialog.delete-dossier.confirmation-text'), requireInput: true, denyText: _('confirmation-dialog.delete-dossier.deny-text'), diff --git a/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts b/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts new file mode 100644 index 000000000..7fd447e6e --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/translations/file-status-translations.ts @@ -0,0 +1,16 @@ +import { FileStatus } from '@redaction/red-ui-http'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const fileStatusTranslations: { [key in FileStatus.StatusEnum]: string } = { + APPROVED: _('file-status.approved'), + ERROR: _('file-status.error'), + EXCLUDED: _('file-status.excluded'), + FULLREPROCESS: _('file-status.full-reprocess'), + OCR_PROCESSING: _('file-status.ocr-processing'), + PROCESSING: _('file-status.processing'), + REPROCESS: _('file-status.reprocess'), + UNASSIGNED: _('file-status.unassigned'), + UNDER_APPROVAL: _('file-status.under-approval'), + UNDER_REVIEW: _('file-status.under-review'), + UNPROCESSED: _('file-status.unprocessed') +}; diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index e631566c6..eb5f2ed92 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -40,7 +40,6 @@ export class ConfirmationDialogComponent { config: ConfirmationDialogInput; inputValue = ''; readonly inputLabel: string; - private readonly _inputLabelKey = 'confirmation-dialog.delete-dossier.input-label'; constructor( private readonly _dialogRef: MatDialogRef, @@ -49,7 +48,7 @@ export class ConfirmationDialogComponent { ) { this.config = _confirmationDialogInput ?? new ConfirmationDialogInput(); this.config = this.translate(this.config); - this.inputLabel = this.translate(this._inputLabelKey) + ` '${this.config.confirmationText}'`; + this.inputLabel = this.translate('confirmation-dialog.delete-dossier.input-label') + ` '${this.config.confirmationText}'`; } get isDeleteAction() { 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 d2930ebaa..3056f1d6b 100644 --- a/apps/red-ui/src/app/services/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -7,8 +7,6 @@ import { rolesTranslations } from '../translations/roles-translations'; providedIn: 'root' }) export class TranslateChartService { - translations = rolesTranslations; - constructor(private readonly _translateService: TranslateService) {} translateStatus(config: DoughnutChartConfig[]): DoughnutChartConfig[] { @@ -18,7 +16,7 @@ export class TranslateChartService { translateRoles(config: DoughnutChartConfig[]): DoughnutChartConfig[] { return config.map(val => ({ ...val, - label: this._translateService.instant(this.translations[val.label]).toLowerCase() + label: this._translateService.instant(rolesTranslations[val.label]).toLowerCase() })); } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index fa4c2bc2a..2039247b8 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -233,8 +233,6 @@ "suggestion-remove-dictionary": "Suggested dictionary removal" }, "annotations": "Annotations", - "app-name": "DDA-R", - "APPROVED": "Approved", "archived": "Archived", "assign-dossier-owner": { "dialog": { @@ -318,7 +316,6 @@ "comment": "Comment", "comments": { "add-comment": "Enter comment", - "cancel": "Cancel", "comments": "{count} {count, plural, one{comment} other{comments}}", "hide-comments": "Hide comments" }, @@ -807,8 +804,6 @@ "unsaved-changes": "You have unsaved changes. Save or revert before changing the tab." }, "efsa": "EFSA Approval", - "ERROR": "Re-processing required", - "EXCLUDED": "Excluded", "file-attribute-types": { "date": "Date", "number": "Number", @@ -969,6 +964,19 @@ }, "unassigned": "Unassigned" }, + "file-status": { + "approved": "Approved", + "error": "Re-processing required", + "excluded": "Excluded", + "full-reprocess": "Processing", + "ocr-processing": "OCR Processing", + "processing": "Processing", + "reprocess": "Processing", + "unassigned": "Unassigned", + "under-approval": "Under Approval", + "under-review": "Under Review", + "unprocessed": "Unprocessed" + }, "filter": { "analysis": "Analysis required", "hint": "Hints only", @@ -995,7 +1003,6 @@ "status": "Status" }, "finished": "Finished", - "FULLREPROCESS": "Processing", "hint": "Hint", "initials-avatar": { "unassigned": "Unassigned", @@ -1072,7 +1079,6 @@ "tomorrow": "Tomorrow", "yesterday": "Yesterday" }, - "OCR_PROCESSING": "OCR Processing", "overwrite-files-dialog": { "options": { "cancel": "Cancel all uploads", @@ -1097,7 +1103,6 @@ }, "pending-analysis": "Pending Re-Analysis", "pending-changes-guard": "WARNING: You have unsaved changes. Press Cancel to go back and save these changes, or OK to lose these changes.", - "PROCESSING": "Processing", "readonly": "Read only", "recategorize-image-dialog": { "actions": { @@ -1149,7 +1154,6 @@ "title": "Reports", "upload-document": "Upload a Document" }, - "REPROCESS": "Processing", "reset-filters": "Reset Filters", "reset-password-dialog": { "actions": { @@ -1239,8 +1243,8 @@ "submitted": "Submitted", "suggestion": "Suggestion for redaction", "time": { - "hours": "{hours} {hours, plural, one{hour} other{hours}}", "days": "{days} {days, plural, one{day} other{days}}", + "hours": "{hours} {hours, plural, one{hour} other{hours}}", "less-than-an-hour": "< 1 hour", "no-time-left": "Time to restore already passed" }, @@ -1293,10 +1297,6 @@ } }, "type": "Type", - "UNASSIGNED": "Unassigned", - "UNDER_APPROVAL": "Under Approval", - "UNDER_REVIEW": "Under Review", - "UNPROCESSED": "Unprocessed", "upload-status": { "dialog": { "actions": { diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index d36837b91..f8e4417e8 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -4,6 +4,7 @@ "all": "", "none": "" }, + "active": "", "add-dossier-dialog": { "actions": { "save": "", @@ -230,6 +231,7 @@ "suggestion-remove-dictionary": "" }, "annotations": "", + "archived": "", "assign-dossier-owner": { "dialog": { "approvers": "", @@ -349,6 +351,7 @@ "delete-dossier": { "confirmation-text": "", "deny-text": "", + "details": "", "question": "", "title": "" }, @@ -885,6 +888,19 @@ } } }, + "file-status": { + "approved": "", + "error": "", + "excluded": "", + "full-reprocess": "", + "ocr-processing": "", + "processing": "", + "reprocess": "", + "unassigned": "", + "under-approval": "", + "under-review": "", + "unprocessed": "" + }, "filter-menu": { "filter-options": "", "filter-types": "", From 346203f8afa13221ed389bdd2c5c1786864e276a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 22 Jul 2021 18:21:44 +0300 Subject: [PATCH 21/25] Translation rework: select component, other fixes --- .../src/app/models/file/annotation.wrapper.ts | 3 ++- ...dit-dossier-template-dialog.component.html | 6 ++--- ...-edit-dossier-template-dialog.component.ts | 14 ++++++++-- .../screens/rules/rules-screen.component.ts | 5 ++-- .../smtp-config-screen.component.ts | 5 ++-- .../add-dossier-dialog.component.html | 6 ++--- .../add-dossier-dialog.component.ts | 12 ++++++++- ...it-dossier-download-package.component.html | 6 ++--- ...edit-dossier-download-package.component.ts | 14 ++++++++-- .../components/select/select.component.html | 4 +-- .../components/select/select.component.ts | 4 +-- .../download-types-translations.ts | 10 +++++++ .../translations/report-types-translations.ts | 9 +++++++ apps/red-ui/src/assets/i18n/en.json | 19 +++++++------ apps/red-ui/src/assets/i18n/te.json | 27 ++++++++++++++++--- 15 files changed, 105 insertions(+), 39 deletions(-) create mode 100644 apps/red-ui/src/app/translations/download-types-translations.ts create mode 100644 apps/red-ui/src/app/translations/report-types-translations.ts diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 177f4cc9b..fa479ddee 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -1,6 +1,7 @@ import { Comment, Point, Rectangle } from '@redaction/red-ui-http'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { annotationTypesTranslations } from '../../translations/annotation-types-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export type AnnotationSuperType = | 'add-dictionary' @@ -68,7 +69,7 @@ export class AnnotationWrapper { } get descriptor() { - return this.isModifyDictionary ? 'dictionary' : 'type'; + return this.isModifyDictionary ? _('dictionary') : _('type'); } get hasTextAfter() { diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html index 6bf2167c7..8b5e73dd5 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dossier-template-dialog/add-edit-dossier-template-dialog.component.html @@ -80,8 +80,7 @@ length: this.dossierTemplateForm.controls['reportTypes'].value.length } " - [options]="reportTypesEnum" - [translatePrefix]="'report-type.'" + [options]="reportTypes" class="mr-16" formControlName="reportTypes" > @@ -93,8 +92,7 @@ length: this.dossierTemplateForm.controls['downloadFileTypes'].value.length } " - [options]="downloadTypesEnum" - [translatePrefix]="'download-type.'" + [options]="downloadTypes" formControlName="downloadFileTypes" >
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 a0da03587..82d40eac0 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 @@ -4,8 +4,10 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import * as moment from 'moment'; import { Moment } from 'moment'; -import { DossierTemplateControllerService, DossierTemplateModel } from '@redaction/red-ui-http'; +import { Dossier, DossierTemplateControllerService, DossierTemplateModel } from '@redaction/red-ui-http'; import { applyIntervalConstraints } from '@utils/date-inputs-utils'; +import { reportTypesTranslations } from '../../../../translations/report-types-translations'; +import { downloadTypesTranslations } from '../../../../translations/download-types-translations'; @Component({ selector: 'redaction-add-edit-dossier-template-dialog', @@ -16,8 +18,16 @@ export class AddEditDossierTemplateDialogComponent { dossierTemplateForm: FormGroup; hasValidFrom: boolean; hasValidTo: boolean; - downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypesEnum: Dossier.DownloadFileTypesEnum[] = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypes: { key: Dossier.DownloadFileTypesEnum; label: string }[] = this.downloadTypesEnum.map(type => ({ + key: type, + label: downloadTypesTranslations[type] + })); reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum); + reportTypes: { key: DossierTemplateModel.ReportTypesEnum; label: string }[] = this.reportTypesEnum.map(type => ({ + key: type, + label: reportTypesTranslations[type] + })); private _previousValidFrom: Moment; private _previousValidTo: Moment; 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 0041c99d9..e8c8065ab 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 @@ -8,6 +8,7 @@ import { ComponentHasChanges } from '@guards/can-deactivate.guard'; import { ActivatedRoute } from '@angular/router'; import { AppStateService } from '@state/app-state.service'; import { debounce } from '../../../../utils/debounce'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import ICodeEditor = monaco.editor.ICodeEditor; import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; import IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorConstructionOptions; @@ -95,11 +96,11 @@ export class RulesScreenComponent extends ComponentHasChanges implements OnInit .then( async () => { await this._initialize(); - this._toaster.success('rules-screen.success.generic'); + this._toaster.success(_('rules-screen.success.generic')); }, () => { this.processing = false; - this._toaster.error('rules-screen.error.generic'); + this._toaster.error(_('rules-screen.error.generic')); } ); } 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 5669469cb..d89fdc07b 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 @@ -10,6 +10,7 @@ import { } from '@redaction/red-ui-http'; import { Toaster } from '@services/toaster.service'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-smtp-config-screen', @@ -110,9 +111,9 @@ export class SmtpConfigScreenComponent extends AutoUnsubscribeComponent implemen this.viewReady = false; try { await this._smtpConfigService.testSMTPConfiguration(this.configForm.getRawValue()).toPromise(); - this._toaster.success('smtp-config-screen.test.success'); + this._toaster.success(_('smtp-config-screen.test.success')); } catch (e) { - this._toaster.error('smtp-config-screen.test.error'); + this._toaster.error(_('smtp-config-screen.test.error')); } finally { this.viewReady = true; } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html index 405737a9a..0acb92175 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/add-dossier-dialog/add-dossier-dialog.component.html @@ -63,15 +63,13 @@
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 a0cf0b415..e722b7865 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 @@ -4,6 +4,8 @@ import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import * as moment from 'moment'; +import { reportTypesTranslations } from '../../../../translations/report-types-translations'; +import { downloadTypesTranslations } from '../../../../translations/download-types-translations'; @Component({ selector: 'redaction-add-dossier-dialog', @@ -13,8 +15,16 @@ import * as moment from 'moment'; export class AddDossierDialogComponent { dossierForm: FormGroup; hasDueDate = false; - downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypesEnum: Dossier.DownloadFileTypesEnum[] = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypes: { key: Dossier.DownloadFileTypesEnum; label: string }[] = this.downloadTypesEnum.map(type => ({ + key: type, + label: downloadTypesTranslations[type] + })); reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum); + reportTypes: { key: DossierTemplateModel.ReportTypesEnum; label: string }[] = this.reportTypesEnum.map(type => ({ + key: type, + label: reportTypesTranslations[type] + })); dossierTemplates: DossierTemplateModel[]; constructor( diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.html index 3e84f42dd..dc7b3d85a 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.html @@ -1,15 +1,13 @@
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts index b336ede21..53b096a80 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts @@ -1,9 +1,11 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { DossierTemplateModel } from '@redaction/red-ui-http'; +import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { DossierWrapper } from '@state/model/dossier.wrapper'; import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; +import { reportTypesTranslations } from '../../../../../translations/report-types-translations'; +import { downloadTypesTranslations } from '../../../../../translations/download-types-translations'; @Component({ selector: 'redaction-edit-dossier-download-package', @@ -12,8 +14,16 @@ import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; }) export class EditDossierDownloadPackageComponent implements OnInit, EditDossierSectionInterface { dossierForm: FormGroup; - downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypesEnum: Dossier.DownloadFileTypesEnum[] = ['ORIGINAL', 'PREVIEW', 'REDACTED']; + downloadTypes: { key: Dossier.DownloadFileTypesEnum; label: string }[] = this.downloadTypesEnum.map(type => ({ + key: type, + label: downloadTypesTranslations[type] + })); reportTypesEnum = Object.values(DossierTemplateModel.ReportTypesEnum); + reportTypes: { key: DossierTemplateModel.ReportTypesEnum; label: string }[] = this.reportTypesEnum.map(type => ({ + key: type, + label: reportTypesTranslations[type] + })); dossierTemplates: DossierTemplateModel[]; @Input() dossierWrapper: DossierWrapper; diff --git a/apps/red-ui/src/app/modules/shared/components/select/select.component.html b/apps/red-ui/src/app/modules/shared/components/select/select.component.html index 0e8028605..3db1bbe33 100644 --- a/apps/red-ui/src/app/modules/shared/components/select/select.component.html +++ b/apps/red-ui/src/app/modules/shared/components/select/select.component.html @@ -7,7 +7,7 @@
- - {{ translatePrefix + option | translate }} + + {{ option.label | translate }} 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 2ad05e879..bd46a7270 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 @@ -2,6 +2,7 @@ import { AfterViewInit, ChangeDetectorRef, Component, Input, ViewChild } from '@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { MatChip, MatChipList } from '@angular/material/chips'; import { map } from 'rxjs/operators'; +import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http'; @Component({ selector: 'redaction-select', @@ -17,8 +18,7 @@ import { map } from 'rxjs/operators'; }) export class SelectComponent implements AfterViewInit, ControlValueAccessor { @Input() label: string; - @Input() options: string[]; - @Input() translatePrefix = ''; + @Input() options: { key: DossierTemplateModel.ReportTypesEnum | Dossier.DownloadFileTypesEnum; label: string }[]; @Input() disabled = false; @Input() multiple = true; diff --git a/apps/red-ui/src/app/translations/download-types-translations.ts b/apps/red-ui/src/app/translations/download-types-translations.ts new file mode 100644 index 000000000..9ebd5604c --- /dev/null +++ b/apps/red-ui/src/app/translations/download-types-translations.ts @@ -0,0 +1,10 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { Dossier } from '@redaction/red-ui-http'; + +export const downloadTypesTranslations: { [key in Dossier.DownloadFileTypesEnum]: string } = { + ORIGINAL: _('download-type.original'), + PREVIEW: _('download-type.preview'), + REDACTED: _('download-type.redacted'), + ANNOTATED: _('download-type.annotated'), + FLATTEN: _('download-type.flatten') +}; diff --git a/apps/red-ui/src/app/translations/report-types-translations.ts b/apps/red-ui/src/app/translations/report-types-translations.ts new file mode 100644 index 000000000..954b37dba --- /dev/null +++ b/apps/red-ui/src/app/translations/report-types-translations.ts @@ -0,0 +1,9 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { DossierTemplateModel } from '@redaction/red-ui-http'; + +export const reportTypesTranslations: { [key in DossierTemplateModel.ReportTypesEnum]: string } = { + EXCEL_MULTI_FILE: _('report-type.excel-multi-file'), + EXCEL_SINGLE_FILE: _('report-type.excel-single-file'), + WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE: _('report-type.word-single-file-appendix-a1'), + WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE: _('report-type.word-single-file-appendix-a2') +}; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 2039247b8..aabcd5d98 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -722,10 +722,12 @@ "queued": "Your download has been queued, you can see all your requested downloads here: My Downloads ." }, "download-type": { + "annotated": "Annotated PDF", + "flatten": "Flatten PDF", "label": "{length} document versions", - "ORIGINAL": "Optimized PDF", - "PREVIEW": "Preview PDF", - "REDACTED": "Redacted PDF" + "original": "Optimized PDF", + "preview": "Preview PDF", + "redacted": "Redacted PDF" }, "downloads-list": { "actions": { @@ -1139,11 +1141,11 @@ "value": "Value" }, "report-type": { - "EXCEL_MULTI_FILE": "Excel (for all)", - "EXCEL_SINGLE_FILE": "Excel (per file)", + "excel-multi-file": "Excel (for all)", + "excel-single-file": "Excel (per file)", "label": "{length} report types", - "WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE": "Justification Appendix A1", - "WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE": "Justification Appendix A2" + "word-single-file-appendix-a1": "Justification Appendix A1", + "word-single-file-appendix-a2": "Justification Appendix A2" }, "reports": "Reports", "reports-screen": { @@ -1240,7 +1242,6 @@ }, "title": "Configure SMTP Account" }, - "submitted": "Submitted", "suggestion": "Suggestion for redaction", "time": { "days": "{days} {days, plural, one{day} other{days}}", @@ -1284,7 +1285,6 @@ "no-match": { "title": "No dossiers match your current filters." }, - "search": "Search...", "table-col-names": { "deleted-on": "Deleted on", "name": "Name", @@ -1292,7 +1292,6 @@ "time-to-restore": "Time to restore" }, "table-header": { - "info": "Deleted items can be restored up to {hours} hours from their deletions", "title": "{length} deleted dossiers" } }, diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json index f8e4417e8..b0692e54b 100644 --- a/apps/red-ui/src/assets/i18n/te.json +++ b/apps/red-ui/src/assets/i18n/te.json @@ -387,6 +387,7 @@ }, "dev-mode": "", "dictionaries": "", + "dictionary": "", "dictionary-listing": { "action": { "delete": "", @@ -675,7 +676,12 @@ }, "download-includes": "", "download-type": { - "label": "" + "annotated": "", + "flatten": "", + "label": "", + "original": "", + "preview": "", + "redacted": "" }, "downloads-list": { "actions": { @@ -1041,7 +1047,11 @@ "value": "" }, "report-type": { - "label": "" + "excel-multi-file": "", + "excel-single-file": "", + "label": "", + "word-single-file-appendix-a1": "", + "word-single-file-appendix-a2": "" }, "reports": "", "reports-screen": { @@ -1075,8 +1085,14 @@ }, "rule-editor": "", "rules-screen": { + "error": { + "generic": "" + }, "revert-changes": "", - "save-changes": "" + "save-changes": "", + "success": { + "generic": "" + } }, "smtp-auth-config": { "actions": { @@ -1124,6 +1140,10 @@ "title": "" }, "subtitle": "", + "test": { + "error": "", + "success": "" + }, "title": "" }, "time": { @@ -1178,6 +1198,7 @@ "title": "" } }, + "type": "", "upload-status": { "dialog": { "actions": { From d5c55b33e2a1780d16d3c2bc693b2a573255439e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Fri, 23 Jul 2021 00:21:14 +0300 Subject: [PATCH 22/25] Translation rework: extract strings done --- .../admin-side-nav.component.html | 2 +- .../admin-side-nav.component.ts | 10 +- .../edit-color-dialog.component.ts | 7 +- ...ttributes-csv-import-dialog.component.html | 4 +- ...-attributes-csv-import-dialog.component.ts | 5 +- .../screens/audit/audit-screen.component.ts | 3 +- .../default-colors-screen.component.html | 2 +- .../dictionary-listing-screen.component.html | 2 +- .../dictionary-overview-screen.component.html | 2 +- .../digital-signature-screen.component.ts | 11 +- ...r-attributes-listing-screen.component.html | 4 +- ...e-attributes-listing-screen.component.html | 2 +- .../reports/reports-screen.component.html | 2 +- .../screens/rules/rules-screen.component.html | 2 +- .../user-listing-screen.component.ts | 3 +- .../watermark/watermark-screen.component.html | 2 +- .../admin-side-nav-translations.ts | 6 + .../dossier-details.component.html | 6 +- .../dossier-details.component.ts | 3 + .../file-actions/file-actions.component.ts | 4 +- .../page-exclusion.component.ts | 3 +- .../edit-dossier-attributes.component.html | 4 +- .../edit-dossier-dialog.component.html | 2 +- .../edit-dossier-dialog.component.ts | 5 +- .../edit-dossier-general-info.component.ts | 3 +- .../recategorize-image-dialog.component.html | 2 +- .../recategorize-image-dialog.component.ts | 5 +- .../dossier/models/image-category.model.ts | 1 + .../dossier-listing-screen.component.html | 5 +- .../dossier-listing-screen.component.ts | 2 +- .../dossier-overview-screen.component.ts | 5 +- .../file-preview-screen.component.html | 2 +- .../services/annotation-processing.service.ts | 5 +- .../services/manual-annotation.service.ts | 13 +- .../image-categories-translations.ts | 9 + .../shared/base/base-listing.component.ts | 9 + .../file-download-btn.component.ts | 3 +- .../dictionary-manager.component.ts | 3 +- .../side-nav/side-nav.component.html | 2 +- .../confirmation-dialog.component.ts | 3 +- .../services/dictionary-save.service.ts | 7 +- .../red-ui/src/app/state/app-state.service.ts | 2 +- .../app/utils/missing-translations-handler.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 86 +- apps/red-ui/src/assets/i18n/te.json | 1279 ----------------- package.json | 2 +- 46 files changed, 139 insertions(+), 1407 deletions(-) create mode 100644 apps/red-ui/src/app/modules/admin/translations/admin-side-nav-translations.ts create mode 100644 apps/red-ui/src/app/modules/dossier/models/image-category.model.ts create mode 100644 apps/red-ui/src/app/modules/dossier/translations/image-categories-translations.ts delete mode 100644 apps/red-ui/src/assets/i18n/te.json diff --git a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html index 65bbc2a89..c7f2cb60a 100644 --- a/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html +++ b/apps/red-ui/src/app/modules/admin/admin-side-nav/admin-side-nav.component.html @@ -1,4 +1,4 @@ - +
-
- {{ 'file-attributes-csv-import.csv-column' + (previewExpanded ? '' : '-preview') | translate }} -
+
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html index b921d38b3..b6cac2fd1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html @@ -17,7 +17,7 @@
- +
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 52eb89937..40e1787dd 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 @@ -51,7 +51,7 @@
- + { this.loadDigitalSignatureAndInitializeForm(); - this._toaster.success('digital-signature-screen.action.save-success'); + this._toaster.success(_('digital-signature-screen.action.save-success')); }, error => { if (error.status === 400) { - this._toaster.error('digital-signature-screen.action.certificate-not-valid-error'); + this._toaster.error(_('digital-signature-screen.action.certificate-not-valid-error')); } else { - this._toaster.error('digital-signature-screen.action.save-error'); + this._toaster.error(_('digital-signature-screen.action.save-error')); } } ); @@ -63,9 +64,9 @@ export class DigitalSignatureScreenComponent extends AutoUnsubscribeComponent im this.addSubscription = this._digitalSignatureControllerService.deleteDigitalSignature().subscribe( () => { this.loadDigitalSignatureAndInitializeForm(); - this._toaster.success('digital-signature-screen.action.delete-success'); + this._toaster.success(_('digital-signature-screen.action.delete-success')); }, - () => this._toaster.error('digital-signature-screen.action.delete-error') + () => this._toaster.error(_('digital-signature-screen.action.delete-error')) ); } diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html index c9bd4a764..fd8b8381d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-attributes-listing/dossier-attributes-listing-screen.component.html @@ -17,7 +17,7 @@
- +
@@ -129,7 +129,7 @@ diff --git a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html index 1edc6b311..6b4280c2d 100644 --- a/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html @@ -17,7 +17,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html index 118929ae0..c80a5168a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.html @@ -17,7 +17,7 @@
- +
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 66b8b7847..95c117176 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 @@ -17,7 +17,7 @@
- +
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 f22bf6f97..cb88b3ddd 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 @@ -66,8 +66,9 @@ export class UserListingScreenComponent extends BaseListingComponent imple } getDisplayRoles(user: User) { + const separator = ', '; return ( - user.roles.map(role => this._translateService.instant(this.translations[role])).join(', ') || + user.roles.map(role => this._translateService.instant(this.translations[role])).join(separator) || this._translateService.instant(this.translations['NO_ROLE']) ); } diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html index 40f32fa43..5c96350ac 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html @@ -17,7 +17,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/admin/translations/admin-side-nav-translations.ts b/apps/red-ui/src/app/modules/admin/translations/admin-side-nav-translations.ts new file mode 100644 index 000000000..b3c5972b5 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/translations/admin-side-nav-translations.ts @@ -0,0 +1,6 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + +export const adminSideNavTranslations = { + settings: _('admin-side-nav.settings'), + dossierTemplates: _('admin-side-nav.dossier-templates') +}; 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 c5a606aa3..dbd094540 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 @@ -1,15 +1,13 @@
- +
{{ appStateService.activeDossier.dossier.dossierName }}
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 c0499b196..f26e9927c 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 @@ -11,6 +11,7 @@ import { Toaster } from '@services/toaster.service'; import { FilterService } from '@shared/services/filter.service'; import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { fileStatusTranslations } from '../../translations/file-status-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-dossier-details', @@ -25,6 +26,8 @@ export class DossierDetailsComponent implements OnInit { @Output() openAssignDossierMembersDialog = new EventEmitter(); @Output() openDossierDictionaryDialog = new EventEmitter(); @Output() toggleCollapse = new EventEmitter(); + collapseTooltip = _('dossier-details.collapse'); + expandTooltip = _('dossier-details.expand'); readonly needsWorkFilters$ = this.filterService.getFilterModels$('needsWorkFilters'); diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts index d57fcb2d5..134e5c222 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.ts @@ -48,10 +48,10 @@ export class FileActionsComponent implements OnInit { get toggleTooltip(): string { if (!this.permissionsService.isManager()) { - return 'file-preview.toggle-analysis.only-managers'; + return _('file-preview.toggle-analysis.only-managers'); } - return this.fileStatus?.isExcluded ? 'file-preview.toggle-analysis.enable' : 'file-preview.toggle-analysis.disable'; + return this.fileStatus?.isExcluded ? _('file-preview.toggle-analysis.enable') : _('file-preview.toggle-analysis.disable'); } get canAssignToSelf() { diff --git a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts index 8a03fed66..991fd9b77 100644 --- a/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/page-exclusion/page-exclusion.component.ts @@ -5,6 +5,7 @@ import { PageRange, ReanalysisControllerService } from '@redaction/red-ui-http'; import { FileDataModel } from '../../../../models/file/file-data.model'; import { Toaster } from '@services/toaster.service'; import { LoadingService } from '@services/loading.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-page-exclusion', @@ -78,7 +79,7 @@ export class PageExclusionComponent implements OnChanges { this.excludePagesForm.reset(); this.actionPerformed.emit('exclude-pages'); } catch (e) { - this._toaster.error('file-preview.tabs.exclude-pages.error'); + this._toaster.error(_('file-preview.tabs.exclude-pages.error')); this._loadingService.stop(); } } diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html index ded16d096..5037d8497 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/attributes/edit-dossier-attributes.component.html @@ -6,8 +6,8 @@
@@ -36,8 +36,8 @@
- +
- {{ 'recategorize-image-dialog.options.' + option | translate }} + {{ translations[option] | translate }}
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts index 5372c1a07..f6ba498c7 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts @@ -3,6 +3,8 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { PermissionsService } from '@services/permissions.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; +import { imageCategoriesTranslations } from '../../translations/image-categories-translations'; +import { ImageCategory } from '../../models/image-category.model'; @Component({ selector: 'redaction-recategorize-image-dialog', @@ -12,7 +14,8 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; export class RecategorizeImageDialogComponent implements OnInit { recategorizeImageForm: FormGroup; isDocumentAdmin: boolean; - typeOptions: string[] = ['signature', 'logo', 'formula', 'image']; + typeOptions: ImageCategory[] = ['signature', 'logo', 'formula', 'image']; + translations = imageCategoriesTranslations; constructor( private readonly _permissionsService: PermissionsService, diff --git a/apps/red-ui/src/app/modules/dossier/models/image-category.model.ts b/apps/red-ui/src/app/modules/dossier/models/image-category.model.ts new file mode 100644 index 000000000..cbfc5355f --- /dev/null +++ b/apps/red-ui/src/app/modules/dossier/models/image-category.model.ts @@ -0,0 +1 @@ +export type ImageCategory = 'signature' | 'logo' | 'formula' | 'image'; 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 0a2b67ad8..8f4cbdf44 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 @@ -8,10 +8,7 @@
- + ; 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 2d808006d..586ea0844 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 @@ -34,6 +34,7 @@ import { DossierAttributeWithValue } from '@models/dossier-attributes.model'; import { UserPreferenceService } from '@services/user-preference.service'; import { workloadTranslations } from '../../translations/workload-translations'; import { fileStatusTranslations } from '../../translations/file-status-translations'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ templateUrl: './dossier-overview-screen.component.html', @@ -148,9 +149,9 @@ export class DossierOverviewScreenComponent .reanalyzeDossier() .then(() => { this.reloadDossiers(); - this._toaster.success('dossier-overview.reanalyse-dossier.success'); + this._toaster.success(_('dossier-overview.reanalyse-dossier.success')); }) - .catch(() => this._toaster.error('dossier-overview.reanalyse-dossier.error')); + .catch(() => this._toaster.error(_('dossier-overview.reanalyse-dossier.error'))); } reloadDossiers() { 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 0e11c468e..c5f7a327e 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 @@ -151,8 +151,8 @@ extends AutoUnsubscribeComponent i readonly sortedDisplayedEntities$: Observable; readonly noMatch$: Observable; + protected readonly _tableHeaderLabel: string; /** * Key used in the *trackBy* function with **ngFor* or **cdkVirtualFor* * and in the default sorting and as the search field @@ -44,6 +45,14 @@ export abstract class BaseListingComponent extends AutoUnsubscribeComponent i this.noMatch$ = this._noMatch$; } + get tableHeaderLabel(): string { + if (!this._tableHeaderLabel) { + throw new Error('Not implemented'); + } + + return this._tableHeaderLabel; + } + get allEntities(): T[] { return this.screenStateService.allEntities; } diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts index 081ec4fbd..25fdf22ef 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts @@ -7,6 +7,7 @@ import { Toaster } from '@services/toaster.service'; import { BASE_HREF } from '../../../../../tokens'; import { AutoUnsubscribeComponent } from '@shared/base/auto-unsubscribe.component'; import { TranslateService } from '@ngx-translate/core'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; export type MenuState = 'OPEN' | 'CLOSED'; @@ -53,7 +54,7 @@ export class FileDownloadBtnComponent extends AutoUnsubscribeComponent implement this.addSubscription = this._fileDownloadService .downloadFiles(Array.isArray(this.file) ? this.file : [this.file], this.dossier) .subscribe(() => { - this._toaster.info('download-status.queued', { params: { baseUrl: this._baseHref } }); + this._toaster.info(_('download-status.queued'), { params: { baseUrl: this._baseHref } }); }); } } diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index 6d1b55de0..3bdaac889 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -5,6 +5,7 @@ import { debounce } from '@utils/debounce'; import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { DossierWrapper } from '@state/model/dossier.wrapper'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import ICodeEditor = monaco.editor.ICodeEditor; import IDiffEditor = monaco.editor.IDiffEditor; import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; @@ -37,7 +38,7 @@ export class DictionaryManagerComponent implements OnChanges, OnInit { showDiffEditor = false; searchText = ''; - selectDossier = { name: 'dictionary-overview.compare.select-dossier' }; + selectDossier = { name: _('dictionary-overview.compare.select-dossier') }; compare: false; private _codeEditor: ICodeEditor; diff --git a/apps/red-ui/src/app/modules/shared/components/side-nav/side-nav.component.html b/apps/red-ui/src/app/modules/shared/components/side-nav/side-nav.component.html index c2695417b..fd93d24b0 100644 --- a/apps/red-ui/src/app/modules/shared/components/side-nav/side-nav.component.html +++ b/apps/red-ui/src/app/modules/shared/components/side-nav/side-nav.component.html @@ -1,3 +1,3 @@ -
+
{{ title }}
diff --git a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts index eb5f2ed92..47f4e943b 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -48,7 +48,8 @@ export class ConfirmationDialogComponent { ) { this.config = _confirmationDialogInput ?? new ConfirmationDialogInput(); this.config = this.translate(this.config); - this.inputLabel = this.translate('confirmation-dialog.delete-dossier.input-label') + ` '${this.config.confirmationText}'`; + this.inputLabel = + this._translateService.instant('confirmation-dialog.delete-dossier.input-label') + ` '${this.config.confirmationText}'`; } get isDeleteAction() { 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 1f74a33d5..87523196d 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 @@ -3,6 +3,7 @@ import { Observable, throwError } from 'rxjs'; import { Toaster } from '@services/toaster.service'; import { DictionaryControllerService } from '@redaction/red-ui-http'; import { tap } from 'rxjs/operators'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; const MIN_WORD_LENGTH = 2; @@ -39,13 +40,13 @@ export class DictionarySaveService { return obs.pipe( tap( () => { - if (showToast) this._toaster.success('dictionary-overview.success.generic'); + if (showToast) this._toaster.success(_('dictionary-overview.success.generic')); }, - () => this._toaster.error('dictionary-overview.error.generic') + () => this._toaster.error(_('dictionary-overview.error.generic')) ) ); } else { - this._toaster.error('dictionary-overview.error.entries-too-short'); + this._toaster.error(_('dictionary-overview.error.entries-too-short')); return throwError('Entries too short'); } 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 fa2139c6b..c1b8914c4 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -331,7 +331,7 @@ export class AppStateService { const index = this.allDossiers.findIndex(p => p.dossierId === dossier.dossierId); this._appState.dossiers.splice(index, 1); }, - () => this._toaster.error('dossiers.delete.delete-failed', { params: dossier }) + () => this._toaster.error(_('dossier-listing.delete.delete-failed'), { params: dossier }) ); } diff --git a/apps/red-ui/src/app/utils/missing-translations-handler.ts b/apps/red-ui/src/app/utils/missing-translations-handler.ts index 436d0ba02..b6b871c45 100644 --- a/apps/red-ui/src/app/utils/missing-translations-handler.ts +++ b/apps/red-ui/src/app/utils/missing-translations-handler.ts @@ -4,6 +4,6 @@ export class REDMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams): any { const missingKey = params.key; console.error('Missing translation: ' + missingKey); - return `?${missingKey}?`; + return missingKey; } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index aabcd5d98..069d2a8ce 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -106,6 +106,10 @@ }, "title": "{type, select, edit{Edit} create{Add New} other{}} User" }, + "admin-side-nav": { + "dossier-templates": "Dossier Templates", + "settings": "Settings" + }, "annotation": "Annotation", "annotation-actions": { "accept-recommendation": { @@ -189,7 +193,6 @@ "error": "Failed to request image recategorization: {error}", "success": "Image recategorization requested." }, - "search": "Document name...", "suggest": { "error": "Failed to save redaction suggestion: {error}", "success": "Redaction suggestion saved" @@ -201,9 +204,7 @@ } }, "recategorize-image": "Recategorize", - "reject": "Reject", "reject-suggestion": "Reject Suggestion", - "remove": "Remove", "remove-annotation": { "false-positive": "False Positive", "only-here": "Remove only here", @@ -237,15 +238,12 @@ "assign-dossier-owner": { "dialog": { "approvers": "Approvers", - "cancel": "Cancel", "make-approver": "Make Approver", "no-approvers": "No approvers yet.\nSelect from the list below.", "no-reviewers": "No reviewers yet.\nSelect from the list below.", "reviewers": "Reviewers", - "save": "Save Changes", "search": "Search...", - "single-user": "Owner", - "title": "Manage Dossier Team" + "single-user": "Owner" } }, "assign-owner": { @@ -299,7 +297,6 @@ "logout": "Logout" }, "by": "by", - "change-legal-basis": "Pending Change of Legal Basis", "change-legal-basis-dialog": { "actions": { "cancel": "Cancel", @@ -313,7 +310,6 @@ }, "header": "Edit Redaction Reason" }, - "comment": "Comment", "comments": { "add-comment": "Enter comment", "comments": "{count} {count, plural, one{comment} other{comments}}", @@ -394,7 +390,6 @@ "updatedColor": "Updated" } }, - "delete-files-error": "Failed to delete files.", "dev-mode": "DEV", "dictionaries": "Dictionaries", "dictionary": "Dictionary", @@ -552,13 +547,9 @@ "action": "Delete Dossier", "delete-failed": "Failed to delete dossier: {dossierName}" }, - "download-files": { - "action": "Download Redacted Files" - }, "edit": { "action": "Edit Dossier" }, - "header": "Dossiers", "no-data": { "action": "New Dossier", "title": "You currently have no dossiers." @@ -591,13 +582,9 @@ "status": "Status" }, "table-header": { - "recent": "Recent", - "title": "{length} active dossiers" + "title": "{length} active {length, plural, one{Dossier} other{Dossiers}}" } }, - "dossier-member-guard": { - "access-denied": "You are not allowed to access that page." - }, "dossier-overview": { "approve": "Approve", "approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed.", @@ -639,7 +626,6 @@ "file-processing": "Processing" } }, - "header": "Dossier Overview", "header-actions": { "edit": "Edit Dossier", "upload-document": "Upload Document" @@ -666,13 +652,13 @@ "recent": "Recent ({hours} h)", "unassigned": "Unassigned" }, - "reanalyse": { - "action": "Analyze File" - }, "reanalyse-dossier": { "error": "Failed to schedule files for reanalysis. Please try again.", "success": "Files scheduled for reanalysis." }, + "reanalyse": { + "action": "Analyze File" + }, "search": "Document name...", "table-col-names": { "added-on": "Added", @@ -741,8 +727,7 @@ "date": "Date", "name": "Name", "size": "Size", - "status": "Status", - "type": "Type" + "status": "Status" }, "table-header": { "title": "{length} downloads" @@ -800,12 +785,11 @@ "download-package": "Download Package", "general-info": "General Information", "members": "Members", - "report-attributes": "Report Attributes", "team-members": "Team Members" }, + "side-nav-title": "Configurations", "unsaved-changes": "You have unsaved changes. Save or revert before changing the tab." }, - "efsa": "EFSA Approval", "file-attribute-types": { "date": "Date", "number": "Number", @@ -909,9 +893,7 @@ "exclude-pages": "Exclude pages from redaction", "excluded-from-redaction": "excluded from redaction", "fullscreen": "Full Screen (F)", - "html-debug": "Open Document HTML Debug", "last-reviewer": "Last Reviewed by:", - "new-tab-ssr": "Open Document in Server Side Rendering Mode", "no-data": { "title": "There are no annotations on this page." }, @@ -919,11 +901,9 @@ "jump-first": "Jump to first page", "jump-last": "Jump to last page" }, - "reanalyse-file": "File reanalysis in progress", "reanalyse-notification": "This document was not processed with the latest rule/dictionary set. Analyze now to get updated annotations.", "redacted": "Preview", "redacted-tooltip": "Redaction preview shows only redactions. Consider this a preview for the final redacted version. This view is only available if the file has no pending changes & doesn't require a reanalysis", - "reviewer": "Assigned to", "standard": "Standard", "standard-tooltip": "Standard Workload view shows all hints, redactions, recommendations & suggestions. This view allows editing.", "tabs": { @@ -963,8 +943,7 @@ "disable": "Disable redaction", "enable": "Enable for redaction", "only-managers": "Enabling / disabling is permitted only for managers" - }, - "unassigned": "Unassigned" + } }, "file-status": { "approved": "Approved", @@ -979,6 +958,13 @@ "under-review": "Under Review", "unprocessed": "Unprocessed" }, + "filter-menu": { + "filter-options": "Filter options", + "filter-types": "Filter types", + "label": "Filter", + "with-comments": "Only annotations with comments", + "with-reason-changes": "Only redactions with reason changes" + }, "filter": { "analysis": "Analysis required", "hint": "Hints only", @@ -988,30 +974,26 @@ "suggestion": "Suggested Redaction", "updated": "Updated" }, - "filter-menu": { - "filter-options": "Filter options", - "filter-types": "Filter types", - "label": "Filter", - "with-comments": "Only annotations with comments", - "with-reason-changes": "Only redactions with reason changes" - }, "filters": { "assigned-people": "Assignee(s)", - "dossier": "Dossier", "dossier-templates": "Rule Sets", "filter-by": "Filter:", "needs-work": "Workload", "people": "Dossier Member(s)", "status": "Status" }, - "finished": "Finished", "hint": "Hint", + "image-category": { + "formula": "Formula", + "image": "Image", + "logo": "Logo", + "signature": "Signature" + }, "initials-avatar": { "unassigned": "Unassigned", "you": "You" }, "license-info-screen": { - "3rd-party-title": "Reference to 3rd Party Licenses", "analyzed-pages": "Analyzed Pages", "backend-version": "Backend Application Version", "chart": { @@ -1025,6 +1007,7 @@ "copyright-claim-title": "Copyright Claim", "current-analyzed": "Analyzed Pages in Current Licensing Period", "custom-app-title": "Custom Application Title", + "email-report": "Email Report", "email": { "body": { "analyzed": "Total Analyzed Pages in current license period: {pages}.", @@ -1032,7 +1015,6 @@ }, "title": "License Report {licenseCustomer}" }, - "email-report": "Email Report", "end-user-license-text": "The use of this product is subject to the terms of the Redaction End User Agreement, unless other specified therein.", "end-user-license-title": "End User License Agreement", "frontend-version": "Frontend Application Version", @@ -1068,10 +1050,6 @@ "request-false-positive": "Request false positive", "request-redaction": "Request Redaction" } - }, - "undo": { - "error": "Failed to undo action.", - "success": "Action undone." } }, "notifications": { @@ -1103,7 +1081,6 @@ } } }, - "pending-analysis": "Pending Re-Analysis", "pending-changes-guard": "WARNING: You have unsaved changes. Press Cancel to go back and save these changes, or OK to lose these changes.", "readonly": "Read only", "recategorize-image-dialog": { @@ -1116,13 +1093,7 @@ "type": "Select image type", "type-placeholder": "Select a type..." }, - "header": "Edit Image Type", - "options": { - "formula": "Formula", - "image": "Image", - "logo": "Logo", - "signature": "Signature" - } + "header": "Edit Image Type" }, "redaction": "Redaction", "remove-annotations-dialog": { @@ -1188,8 +1159,6 @@ "generic": "Rules updated!" } }, - "settings": "Settings", - "skipped": "Skipped", "smtp-auth-config": { "actions": { "cancel": "Cancel", @@ -1242,7 +1211,6 @@ }, "title": "Configure SMTP Account" }, - "suggestion": "Suggestion for redaction", "time": { "days": "{days} {days, plural, one{day} other{days}}", "hours": "{hours} {hours, plural, one{hour} other{hours}}", diff --git a/apps/red-ui/src/assets/i18n/te.json b/apps/red-ui/src/assets/i18n/te.json deleted file mode 100644 index b0692e54b..000000000 --- a/apps/red-ui/src/assets/i18n/te.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - ", ": "", - "actions": { - "all": "", - "none": "" - }, - "active": "", - "add-dossier-dialog": { - "actions": { - "save": "", - "save-and-add-members": "" - }, - "errors": { - "dossier-already-exists": "", - "generic": "" - }, - "form": { - "description": { - "label": "", - "placeholder": "" - }, - "due-date": "", - "name": { - "label": "", - "placeholder": "" - }, - "template": "", - "watermark": "" - }, - "header-new": "" - }, - "add-edit-dictionary": { - "error": { - "dictionary-already-exists": "", - "generic": "", - "invalid-color-or-rank": "" - }, - "form": { - "add-to-dictionary-action": "", - "case-sensitive": "", - "color": "", - "color-placeholder": "", - "description": "", - "description-placeholder": "", - "hint": "", - "name": "", - "name-hint": "", - "name-placeholder": "", - "rank": "", - "rank-placeholder": "", - "redaction": "" - }, - "save": "", - "title": "" - }, - "add-edit-dossier-attribute": { - "error": { - "generic": "" - }, - "form": { - "label": "", - "label-placeholder": "", - "placeholder": "", - "type": "" - }, - "save": "", - "title": "" - }, - "add-edit-dossier-template": { - "form": { - "description": "", - "description-placeholder": "", - "name": "", - "name-placeholder": "", - "valid-from": "", - "valid-to": "" - }, - "save": "", - "title": "" - }, - "add-edit-file-attribute": { - "form": { - "column-header": "", - "column-header-placeholder": "", - "name": "", - "name-placeholder": "", - "primary": "", - "read-only": "", - "type": "" - }, - "save": "", - "title": "" - }, - "add-edit-user": { - "actions": { - "cancel": "", - "delete": "", - "save": "", - "save-changes": "" - }, - "form": { - "email": "", - "first-name": "", - "last-name": "", - "reset-password": "", - "role": "" - }, - "title": "" - }, - "annotation": "", - "annotation-actions": { - "accept-recommendation": { - "label": "" - }, - "accept-suggestion": { - "label": "" - }, - "edit-reason": { - "label": "" - }, - "force-redaction": { - "label": "" - }, - "hide": "", - "message": { - "dictionary": { - "add": { - "error": "", - "success": "" - }, - "approve": { - "error": "", - "success": "" - }, - "decline": { - "error": "", - "success": "" - }, - "remove": { - "error": "", - "success": "" - }, - "request-remove": { - "error": "", - "success": "" - }, - "suggest": { - "error": "", - "success": "" - }, - "undo": { - "error": "", - "success": "" - } - }, - "manual-redaction": { - "add": { - "error": "", - "success": "" - }, - "approve": { - "error": "", - "success": "" - }, - "change-legal-basis": { - "error": "", - "success": "" - }, - "decline": { - "error": "", - "success": "" - }, - "force-redaction": { - "error": "", - "success": "" - }, - "recategorize-image": { - "error": "", - "success": "" - }, - "request-change-legal-basis": { - "error": "", - "success": "" - }, - "request-force-redaction": { - "error": "", - "success": "" - }, - "request-image-recategorization": { - "error": "", - "success": "" - }, - "suggest": { - "error": "", - "success": "" - }, - "undo": { - "error": "", - "success": "" - } - } - }, - "recategorize-image": "", - "reject-suggestion": "", - "remove-annotation": { - "false-positive": "", - "only-here": "", - "remove-from-dict": "" - }, - "show": "", - "undo": "" - }, - "annotation-type": { - "add-dictionary": "", - "change-legal-basis": "", - "declined-suggestion": "", - "hint": "", - "manual-redaction": "", - "pending-analysis": "", - "recommendation": "", - "redaction": "", - "remove-dictionary": "", - "remove-only-here": "", - "skipped": "", - "suggestion-add": "", - "suggestion-add-dictionary": "", - "suggestion-change-legal-basis": "", - "suggestion-force-redaction": "", - "suggestion-recategorize-image": "", - "suggestion-remove": "", - "suggestion-remove-dictionary": "" - }, - "annotations": "", - "archived": "", - "assign-dossier-owner": { - "dialog": { - "approvers": "", - "make-approver": "", - "no-approvers": "", - "no-reviewers": "", - "reviewers": "", - "search": "", - "single-user": "" - } - }, - "assign-owner": { - "dialog": { - "cancel": "", - "label": "", - "save": "", - "title": "" - } - }, - "assign-user": { - "cancel": "", - "save": "" - }, - "audit": "", - "audit-screen": { - "categories": { - "all-categories": "", - "audit": "", - "audit-log": "", - "dictionary": "", - "document": "", - "dossier": "", - "dossier-template": "", - "download": "", - "license": "", - "project": "", - "project-template": "", - "user": "" - }, - "no-data": { - "title": "" - }, - "table-col-names": { - "category": "", - "date": "", - "message": "", - "user": "" - }, - "table-header": { - "title": "" - }, - "to": "" - }, - "auth-error": { - "heading": "", - "heading-with-link": "", - "heading-with-name": "", - "heading-with-name-and-link": "", - "logout": "" - }, - "by": "", - "change-legal-basis-dialog": { - "actions": { - "cancel": "", - "save": "" - }, - "content": { - "comment": "", - "legalBasis": "", - "reason": "", - "reason-placeholder": "" - }, - "header": "" - }, - "comments": { - "add-comment": "", - "comments": "", - "hide-comments": "" - }, - "common": { - "close": "", - "confirmation-dialog": { - "confirm": "", - "deny": "", - "description": "", - "title": "" - } - }, - "configurations": "", - "confirm-delete-file-attribute": { - "cancel": "", - "delete": "", - "impacted-documents": "", - "lost-details": "", - "title": "", - "toast-error": "", - "warning": "" - }, - "confirm-delete-users": { - "cancel": "", - "delete": "", - "impacted-documents": "", - "impacted-dossiers": "", - "title": "", - "toast-error": "", - "warning": "" - }, - "confirmation-dialog": { - "assign-file-to-me": { - "question": "", - "title": "" - }, - "compare-file": { - "question": "", - "title": "" - }, - "delete-dossier": { - "confirmation-text": "", - "deny-text": "", - "details": "", - "question": "", - "title": "" - }, - "delete-file": { - "question": "", - "title": "" - } - }, - "content": "", - "default-colors": "", - "default-colors-screen": { - "action": { - "edit": "" - }, - "table-col-names": { - "color": "", - "key": "" - }, - "table-header": { - "title": "" - }, - "types": { - "analysisColor": "", - "defaultColor": "", - "dictionaryRequestColor": "", - "manualRedactionColor": "", - "notRedacted": "", - "previewColor": "", - "requestAdd": "", - "requestRemove": "", - "updatedColor": "" - } - }, - "dev-mode": "", - "dictionaries": "", - "dictionary": "", - "dictionary-listing": { - "action": { - "delete": "", - "edit": "" - }, - "add-new": "", - "bulk": { - "delete": "" - }, - "case-sensitive": "", - "no-data": { - "action": "", - "title": "" - }, - "no-match": { - "title": "" - }, - "search": "", - "stats": { - "charts": { - "entries": "", - "types": "" - } - }, - "table-col-names": { - "hint-redaction": "", - "order-of-importance": "", - "type": "" - }, - "table-header": { - "title": "" - } - }, - "dictionary-overview": { - "action": { - "delete": "", - "download": "", - "edit": "", - "upload": "" - }, - "compare": { - "compare": "" - }, - "dictionary-details": { - "description": "" - }, - "revert-changes": "", - "save-changes": "", - "search": "", - "select-dictionary": "" - }, - "digital-signature": "", - "digital-signature-screen": { - "action": { - "delete": "", - "reset": "", - "save": "" - }, - "certificate-name": { - "label": "", - "placeholder": "" - }, - "contact-info": { - "label": "", - "placeholder": "" - }, - "location": { - "label": "", - "placeholder": "" - }, - "no-data": { - "action": "", - "title": "" - }, - "password": { - "label": "", - "placeholder": "" - }, - "reason": { - "label": "", - "placeholder": "" - } - }, - "document-info": { - "save": "", - "title": "" - }, - "dossier-attribute-types": { - "date": "", - "image": "", - "number": "", - "text": "" - }, - "dossier-attributes": "", - "dossier-attributes-listing": { - "action": { - "edit": "" - }, - "add-new": "", - "bulk": { - "delete": "" - }, - "no-data": { - "action": "", - "title": "" - }, - "no-match": { - "title": "" - }, - "search": "", - "table-col-names": { - "label": "", - "placeholder": "", - "type": "" - }, - "table-header": { - "title": "" - } - }, - "dossier-details": { - "assign-members": "", - "edit-owner": "", - "members": "", - "owner": "", - "see-less": "", - "title": "" - }, - "dossier-dictionary-dialog": { - "cancel": "", - "save-changes": "", - "title": "" - }, - "dossier-listing": { - "add-new": "", - "delete": { - "action": "" - }, - "edit": { - "action": "" - }, - "no-data": { - "action": "", - "title": "" - }, - "no-match": { - "title": "" - }, - "quick-filters": { - "my-dossiers": "", - "other": "", - "to-approve": "", - "to-review": "" - }, - "reanalyse": { - "action": "" - }, - "search": "", - "stats": { - "analyzed-pages": "", - "charts": { - "dossiers": "", - "total-documents": "" - }, - "total-people": "" - }, - "table-col-names": { - "name": "", - "needs-work": "", - "owner": "", - "status": "" - } - }, - "dossier-overview": { - "approve": "", - "approve-disabled": "", - "assign-approver": "", - "assign-me": "", - "assign-reviewer": "", - "bulk": { - "delete": "", - "reanalyse": "" - }, - "delete": { - "action": "" - }, - "dossier-details": { - "attributes": { - "expand": "", - "image-uploaded": "", - "show-less": "" - }, - "charts": { - "documents-in-dossier": "" - }, - "description": "", - "dictionary": "", - "stats": { - "analysed-pages": "", - "created-on": "", - "documents": "", - "due-date": "", - "people": "" - } - }, - "download-file": "", - "download-file-disabled": "", - "file-listing": { - "file-entry": { - "file-error": "", - "file-pending": "", - "file-processing": "" - } - }, - "header-actions": { - "edit": "", - "upload-document": "" - }, - "new-rule": { - "toast": { - "actions": { - "reanalyse-all": "" - } - } - }, - "no-data": { - "action": "", - "title": "" - }, - "no-match": { - "title": "" - }, - "ocr-file": "", - "ocr-performed": "", - "quick-filters": { - "assigned-to-me": "", - "assigned-to-others": "", - "recent": "", - "unassigned": "" - }, - "reanalyse": { - "action": "" - }, - "search": "", - "table-col-names": { - "added-on": "", - "assigned-to": "", - "name": "", - "needs-work": "", - "pages": "", - "status": "" - }, - "table-header": { - "title": "" - }, - "under-approval": "", - "under-review": "", - "upload-files": "" - }, - "dossier-templates": "", - "dossier-templates-listing": { - "action": { - "delete": "", - "edit": "" - }, - "add-new": "", - "bulk": { - "delete": "" - }, - "dictionaries": "", - "no-data": { - "title": "" - }, - "no-match": { - "title": "" - }, - "search": "", - "table-col-names": { - "created-by": "", - "created-on": "", - "modified-on": "", - "name": "" - }, - "table-header": { - "title": "" - } - }, - "download-includes": "", - "download-type": { - "annotated": "", - "flatten": "", - "label": "", - "original": "", - "preview": "", - "redacted": "" - }, - "downloads-list": { - "actions": { - "delete": "", - "download": "" - }, - "no-data": { - "title": "" - }, - "table-col-names": { - "date": "", - "name": "", - "size": "", - "status": "" - }, - "table-header": { - "title": "" - } - }, - "edit-color-dialog": { - "form": { - "color": "", - "color-placeholder": "" - }, - "save": "" - }, - "edit-dossier-dialog": { - "actions": { - "revert": "", - "save": "" - }, - "attributes": { - "custom-attributes": "", - "delete-image": "", - "image-attributes": "", - "upload-image": "" - }, - "dictionary": { - "entries": "" - }, - "general-info": { - "form": { - "description": { - "label": "", - "placeholder": "" - }, - "due-date": "", - "name": { - "label": "", - "placeholder": "" - }, - "template": "", - "watermark": "" - } - }, - "header": "", - "nav-items": { - "choose-download": "", - "dossier-attributes": "", - "dossier-dictionary": "", - "dossier-info": "", - "download-package": "", - "general-info": "", - "members": "", - "team-members": "" - } - }, - "file-attribute-types": { - "date": "", - "number": "", - "text": "" - }, - "file-attributes": "", - "file-attributes-csv-import": { - "action": { - "cancel-edit-name": "", - "edit-name": "", - "remove": "", - "save-name": "" - }, - "available": "", - "cancel": "", - "delimiter": "", - "delimiter-placeholder": "", - "encoding": "", - "encoding-placeholder": "", - "file": "", - "key-column": "", - "key-column-placeholder": "", - "no-data": { - "title": "" - }, - "no-hovered-column": "", - "no-sample-data-for": "", - "parse-csv": "", - "quick-activation": { - "all": "", - "none": "" - }, - "save": { - "label": "" - }, - "search": { - "placeholder": "" - }, - "selected": "", - "table-col-names": { - "name": "", - "primary": "", - "primary-info-tooltip": "", - "read-only": "", - "type": "" - }, - "table-header": { - "actions": { - "disable-read-only": "", - "enable-read-only": "", - "read-only": "", - "remove-selected": "", - "type": "" - }, - "title": "" - }, - "title": "", - "total-rows": "" - }, - "file-attributes-listing": { - "action": { - "delete": "", - "edit": "" - }, - "add-new": "", - "bulk-actions": { - "delete": "" - }, - "no-data": { - "title": "" - }, - "no-match": { - "title": "" - }, - "read-only": "", - "search": "", - "table-col-names": { - "csv-column": "", - "name": "", - "primary": "", - "primary-info-tooltip": "", - "read-only": "", - "type": "" - }, - "table-header": { - "title": "" - }, - "upload-csv": "" - }, - "file-preview": { - "assign-me": "", - "assign-reviewer": "", - "change-reviewer": "", - "delta": "", - "delta-tooltip": "", - "document-info": "", - "download-original-file": "", - "exclude-pages": "", - "excluded-from-redaction": "", - "fullscreen": "", - "last-reviewer": "", - "no-data": { - "title": "" - }, - "quick-nav": { - "jump-first": "", - "jump-last": "" - }, - "reanalyse-notification": "", - "redacted": "", - "redacted-tooltip": "", - "standard": "", - "standard-tooltip": "", - "tabs": { - "annotations": { - "jump-to-next": "", - "jump-to-previous": "", - "label": "", - "page-is": "", - "select": "", - "select-all": "", - "select-none": "" - }, - "document-info": { - "close": "", - "details": { - "created-on": "", - "dossier": "", - "due": "", - "pages": "" - }, - "edit": "", - "label": "" - }, - "exclude-pages": { - "close": "", - "hint": "", - "input-placeholder": "", - "label": "", - "no-excluded": "", - "put-back": "", - "removed-from-redaction": "" - } - } - }, - "file-status": { - "approved": "", - "error": "", - "excluded": "", - "full-reprocess": "", - "ocr-processing": "", - "processing": "", - "reprocess": "", - "unassigned": "", - "under-approval": "", - "under-review": "", - "unprocessed": "" - }, - "filter-menu": { - "filter-options": "", - "filter-types": "", - "label": "" - }, - "filter": { - "analysis": "", - "hint": "", - "image": "", - "none": "", - "redaction": "", - "suggestion": "", - "updated": "" - }, - "filters": { - "assigned-people": "", - "dossier-templates": "", - "filter-by": "", - "needs-work": "", - "people": "", - "status": "" - }, - "hint": "", - "initials-avatar": { - "unassigned": "", - "you": "" - }, - "license-info-screen": { - "analyzed-pages": "", - "backend-version": "", - "chart": { - "cumulative": "", - "legend": "", - "licensed-total": "", - "pages-per-month": "", - "total-pages": "" - }, - "copyright-claim-text": "", - "copyright-claim-title": "", - "current-analyzed": "", - "custom-app-title": "", - "email-report": "", - "email": { - "body": { - "analyzed": "", - "licensed": "" - }, - "title": "" - }, - "end-user-license-text": "", - "end-user-license-title": "", - "frontend-version": "", - "licensed-page-count": "", - "licensed-to": "", - "licensing-details": "", - "licensing-period": "", - "total-analyzed": "", - "unlicensed-analyzed": "", - "usage-details": "" - }, - "license-information": "", - "manual-annotation": { - "dialog": { - "actions": { - "save": "" - }, - "content": { - "comment": "", - "dictionary": "", - "legalBasis": "", - "reason": "", - "reason-placeholder": "", - "rectangle": "", - "text": "" - }, - "header": { - "force": "" - } - } - }, - "notifications": { - "mark-read": "", - "mark-unread": "", - "today": "", - "tomorrow": "", - "yesterday": "" - }, - "overwrite-files-dialog": { - "options": { - "cancel": "", - "overwrite": "", - "remember": "", - "skip": "" - }, - "question": "", - "title": "" - }, - "page": "", - "pagination": { - "next": "", - "previous": "" - }, - "pdf-viewer": { - "text-popup": { - "actions": { - "search": "" - } - } - }, - "pending-changes-guard": "", - "readonly": "", - "recategorize-image-dialog": { - "actions": { - "cancel": "", - "save": "" - }, - "content": { - "comment": "", - "type": "", - "type-placeholder": "" - }, - "header": "" - }, - "redaction": "", - "remove-annotations-dialog": { - "confirm": "", - "deny": "", - "dictionary": "", - "image-type": "", - "remove-from-dictionary": { - "question": "", - "title": "" - }, - "remove-only-here": { - "question": "", - "title": "" - }, - "value": "" - }, - "report-type": { - "excel-multi-file": "", - "excel-single-file": "", - "label": "", - "word-single-file-appendix-a1": "", - "word-single-file-appendix-a2": "" - }, - "reports": "", - "reports-screen": { - "description": "", - "document-setup-description": "", - "document-setup-heading": "", - "report-documents": "", - "title": "", - "upload-document": "" - }, - "reset-filters": "", - "reset-password-dialog": { - "actions": { - "cancel": "", - "save": "" - }, - "form": { - "password": "" - }, - "header": "" - }, - "roles": { - "inactive": "", - "manager-admin": "", - "no-role": "", - "red-admin": "", - "red-manager": "", - "red-user": "", - "red-user-admin": "", - "regular": "" - }, - "rule-editor": "", - "rules-screen": { - "error": { - "generic": "" - }, - "revert-changes": "", - "save-changes": "", - "success": { - "generic": "" - } - }, - "smtp-auth-config": { - "actions": { - "cancel": "", - "save": "" - }, - "form": { - "password": "", - "username": "", - "username-placeholder": "" - }, - "title": "" - }, - "smtp-config-screen": { - "actions": { - "save": "", - "test-connection": "" - }, - "form": { - "auth": "", - "change-credentials": "", - "envelope-from": "", - "envelope-from-hint": "", - "envelope-from-placeholder": "", - "from": "", - "from-display-name": "", - "from-display-name-hint": "", - "from-display-name-placeholder": "", - "from-placeholder": "", - "host": "", - "host-placeholder": "", - "port": "", - "reply-to": "", - "reply-to-display-name": "", - "reply-to-display-name-placeholder": "", - "reply-to-placeholder": "", - "ssl": "", - "starttls": "" - }, - "general": { - "form": { - "forgot-password": "" - }, - "subtitle": "", - "title": "" - }, - "subtitle": "", - "test": { - "error": "", - "success": "" - }, - "title": "" - }, - "time": { - "days": "", - "hours": "", - "less-than-an-hour": "", - "no-time-left": "" - }, - "top-bar": { - "navigation-items": { - "back": "", - "dossiers": "", - "my-account": { - "children": { - "admin": "", - "downloads": "", - "language": { - "de": "", - "en": "", - "label": "" - }, - "logout": "", - "my-profile": "", - "trash": "" - } - } - } - }, - "trash": { - "action": { - "delete": "", - "restore": "" - }, - "bulk": { - "delete": "", - "restore": "" - }, - "label": "", - "no-data": { - "title": "" - }, - "no-match": { - "title": "" - }, - "table-col-names": { - "deleted-on": "", - "name": "", - "owner": "", - "time-to-restore": "" - }, - "table-header": { - "title": "" - } - }, - "type": "", - "upload-status": { - "dialog": { - "actions": { - "cancel": "", - "re-upload": "" - }, - "title": "" - }, - "error": { - "file-size": "", - "generic": "" - } - }, - "user-listing": { - "action": { - "delete": "", - "edit": "" - }, - "add-new": "", - "bulk": { - "delete": "", - "delete-disabled": "" - }, - "no-match": { - "title": "" - }, - "search": "", - "table-col-names": { - "active": "", - "email": "", - "name": "", - "roles": "" - }, - "table-header": { - "title": "" - } - }, - "user-management": "", - "user-profile": { - "actions": { - "change-password": "", - "save": "" - }, - "form": { - "email": "", - "first-name": "", - "last-name": "" - }, - "title": "" - }, - "user-stats": { - "chart": { - "users": "" - }, - "collapse": "", - "expand": "", - "title": "" - }, - "watermark": "", - "watermark-screen": { - "action": { - "change-success": "", - "delete-success": "", - "error": "", - "revert": "", - "save": "" - }, - "form": { - "color": "", - "font-size": "", - "font-type": "", - "opacity": "", - "orientation": "", - "text-placeholder": "" - }, - "title": "" - } -} diff --git a/package.json b/package.json index 878b9d817..c4b8684a2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "format:check": "nx format:check", "format:write": "nx format:write", "help": "nx help", - "i18n:extract": "ngx-translate-extract --input ./apps/red-ui/src --output apps/red-ui/src/assets/i18n/te.json --clean --sort --format namespaced-json", + "i18n:extract": "ngx-translate-extract --input ./apps/red-ui/src --output apps/red-ui/src/assets/i18n/en.json --clean --sort --format namespaced-json --format-indentation ' '", "postinstall": "ngcc --properties es2015 browser module main", "lint": "nx workspace-lint && nx lint", "lint-fix": "nx workspace-lint --fix && nx lint --fix", From c050b37f5dbaef57aba74ae393816bc30be719bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Fri, 23 Jul 2021 00:29:08 +0300 Subject: [PATCH 23/25] Translation rework: pluralize strings --- .../services/dossiers-dialog.service.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 41 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) 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 c4fff7ae9..becdd9247 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 @@ -205,7 +205,7 @@ export class DossiersDialogService extends DialogService { title: _('confirmation-dialog.delete-dossier.title'), titleColor: TitleColors.PRIMARY, question: _('confirmation-dialog.delete-dossier.question'), - details: _('confirmation-dialog.delete-dossier.details'), + // details: _('confirmation-dialog.delete-dossier.details'), confirmationText: _('confirmation-dialog.delete-dossier.confirmation-text'), requireInput: true, denyText: _('confirmation-dialog.delete-dossier.deny-text'), diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 069d2a8ce..e45ef1e82 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -285,7 +285,7 @@ "user": "User" }, "table-header": { - "title": "{length} Logs" + "title": "{length} {length, plural, one{Log} other{Logs}}" }, "to": "to" }, @@ -355,7 +355,6 @@ "delete-dossier": { "confirmation-text": "Delete Dossier", "deny-text": "Keep Dossier", - "details": "Deleted dossiers are sent to trash. They can be restored up to {period} days from their deletion.", "input-label": "To proceed please type below", "question": "Are you sure you want to delete this dossier?", "title": "Delete {dossierName}" @@ -376,7 +375,7 @@ "key": "Type" }, "table-header": { - "title": "{length} Default Colors" + "title": "{length} Default {length, plural, one{Color} other{Colors}}" }, "types": { "analysisColor": "Analysis", @@ -423,7 +422,7 @@ "type": "Type" }, "table-header": { - "title": "{length} dictionaries" + "title": "{length} {length, plural, one{dictionary} other{dictionaries}}" } }, "dictionary-overview": { @@ -523,7 +522,7 @@ "type": "Type" }, "table-header": { - "title": "{length} dossier attributes" + "title": "{length} dossier {length, plural, one{attribute} other{attributes}}" } }, "dossier-details": { @@ -600,7 +599,7 @@ }, "dossier-details": { "attributes": { - "expand": "{count} custom attributes", + "expand": "{count} custom {count, plural, one{attribute} other{attributes}}", "image-uploaded": "Image uploaded", "show-less": "show less" }, @@ -610,11 +609,11 @@ "description": "Description", "dictionary": "Dossier Dictionary", "stats": { - "analysed-pages": "{count} pages", + "analysed-pages": "{count} {count, plural, one{page} other{pages}}", "created-on": "Created on {date}", - "documents": "{count} documents", + "documents": "{count} {count, plural, one{document} other{documents}}", "due-date": "Due {date}", - "people": "{count} user(s)" + "people": "{count} {count, plural, one{user} other{users}}" } }, "download-file": "Download", @@ -669,7 +668,7 @@ "status": "Status" }, "table-header": { - "title": "{length} documents" + "title": "{length} {length, plural, one{document} other{documents}}" }, "under-approval": "For Approval", "under-review": "Under Review", @@ -685,7 +684,7 @@ "bulk": { "delete": "Delete Selected Dossier Templates" }, - "dictionaries": "{length} dictionaries", + "dictionaries": "{length} {length, plural, one{dictionary} other{dictionaries}}", "no-data": { "title": "There are no dossier templates yet." }, @@ -700,7 +699,7 @@ "name": "Name" }, "table-header": { - "title": "{length} dossier templates" + "title": "{length} dossier {length, plural, one{template} other{templates}}" } }, "download-includes": "Choose what is included at download:", @@ -710,7 +709,7 @@ "download-type": { "annotated": "Annotated PDF", "flatten": "Flatten PDF", - "label": "{length} document versions", + "label": "{length} document {length, plural, one{version} other{versions}}", "original": "Optimized PDF", "preview": "Preview PDF", "redacted": "Redacted PDF" @@ -730,7 +729,7 @@ "status": "Status" }, "table-header": { - "title": "{length} downloads" + "title": "{length} {length, plural, one{download} other{downloads}}" } }, "edit-color-dialog": { @@ -758,7 +757,7 @@ "change-successful": "Dossier was updated.", "delete-successful": "Dossier was deleted.", "dictionary": { - "entries": "{length} entries" + "entries": "{length} {length, plural, one{entry} other{entries}}" }, "general-info": { "form": { @@ -826,7 +825,7 @@ "save": { "error": "Failed to create File Attributes!", "label": "Save Attributes", - "success": "{count} File Attributes created successfully!" + "success": "{count} file {count, plural, one{attribute} other{attributes}} created successfully!" }, "search": { "placeholder": "Search by column name..." @@ -847,7 +846,7 @@ "remove-selected": "Remove Selected", "type": "Type" }, - "title": "{length} file attributes" + "title": "{length} file {length, plural, one{attribute} other{attributes}}" }, "title": "Select CSV columns to use as File Attributes", "total-rows": "{rows} rows in total" @@ -878,7 +877,7 @@ "type": "Input Type" }, "table-header": { - "title": "{length} file attributes" + "title": "{length} file {length, plural, one{attribute} other{attributes}}" }, "upload-csv": "Upload File Attributes Configuration" }, @@ -1114,7 +1113,7 @@ "report-type": { "excel-multi-file": "Excel (for all)", "excel-single-file": "Excel (per file)", - "label": "{length} report types", + "label": "{length} report {length, plural, one{type} other{types}}", "word-single-file-appendix-a1": "Justification Appendix A1", "word-single-file-appendix-a2": "Justification Appendix A2" }, @@ -1260,7 +1259,7 @@ "time-to-restore": "Time to restore" }, "table-header": { - "title": "{length} deleted dossiers" + "title": "{length} deleted {length, plural, one{dossier} other{dossiers}}" } }, "type": "Type", @@ -1298,7 +1297,7 @@ "roles": "Roles" }, "table-header": { - "title": "{length} users" + "title": "{length} {length, plural, one{user} other{users}}" } }, "user-management": "User Management", From 8f2c39a4be3104d3aa8502088a9a2bedb83cf18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 26 Jul 2021 13:59:41 +0300 Subject: [PATCH 24/25] Fix merge --- .../general-config-screen.component.ts | 5 +- apps/red-ui/src/assets/i18n/en.json | 94 +++++++++---------- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts index 750e0741d..7b616319c 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts @@ -12,6 +12,7 @@ import { AppConfigService } from '../../../app-config/app-config.service'; import { AutoUnsubscribeComponent } from '../../../shared/base/auto-unsubscribe.component'; import { Toaster } from '../../../../services/toaster.service'; import { LoadingService } from '../../../../services/loading.service'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-general-config-screen', @@ -124,9 +125,9 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribeComponent imple this._loadingService.start(); try { await this._smtpConfigService.testSMTPConfiguration(this.smtpForm.getRawValue()).toPromise(); - this._toaster.success('smtp-config-screen.test.success'); + this._toaster.success(_('general-config-screen.test.success')); } catch (e) { - this._toaster.error('smtp-config-screen.test.error'); + this._toaster.error(_('general-config-screen.test.error')); } finally { this._loadingService.stop(); } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 041dee3ba..5bb0cf656 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -981,6 +981,50 @@ "people": "Dossier Member(s)", "status": "Status" }, + "general-config-screen": { + "actions": { + "save": "Save Configurations", + "test-connection": "Test Connection" + }, + "app-name": { + "label": "Application Name", + "placeholder": "RedactManager" + }, + "form": { + "auth": "Enable Authentication", + "change-credentials": "Change Credentials", + "envelope-from": "Envelope From", + "envelope-from-hint": "Info text regarding envelope from field.", + "envelope-from-placeholder": "Sender Envelope Email Address", + "from": "From", + "from-display-name": "Name for Sender", + "from-display-name-hint": "Info text regarding the name for sender.", + "from-display-name-placeholder": "Display Name for Sender Email Address", + "from-placeholder": "Sender Email Address", + "host": "Host", + "host-placeholder": "SMTP Host", + "port": "Port", + "reply-to": "Reply To", + "reply-to-display-name": "Name for Reply To", + "reply-to-display-name-placeholder": "Display Name for Reply To Email Address", + "reply-to-placeholder": "Reply To Email Address", + "ssl": "Enable SSL", + "starttls": "Enable StartTLS" + }, + "general": { + "form": { + "forgot-password": "Show Forgot password link on Login screen" + }, + "subtitle": "", + "title": "General Configurations" + }, + "subtitle": "SMTP (Simple Mail Transfer Protocol) enables you to send your emails through the specified server settings.", + "test": { + "error": "Test email could not be sent! Please revise the email address.", + "success": "Test email was sent successfully!" + }, + "title": "Configure SMTP Account" + }, "hint": "Hint", "image-category": { "formula": "Formula", @@ -1111,11 +1155,7 @@ "value": "Value" }, "report-type": { - "excel-multi-file": "Excel (for all)", - "excel-single-file": "Excel (per file)", - "label": "{length} report {length, plural, one{type} other{types}}", - "word-single-file-appendix-a1": "Justification Appendix A1", - "word-single-file-appendix-a2": "Justification Appendix A2" + "label": "{length} report {length, plural, one{type} other{types}}" }, "reports": "Reports", "reports-screen": { @@ -1170,50 +1210,6 @@ }, "title": "Enable Authentication" }, - "general-config-screen": { - "actions": { - "save": "Save Configurations", - "test-connection": "Test Connection" - }, - "app-name": { - "label": "Application Name", - "placeholder": "RedactManager" - }, - "form": { - "auth": "Enable Authentication", - "change-credentials": "Change Credentials", - "envelope-from": "Envelope From", - "envelope-from-hint": "Info text regarding envelope from field.", - "envelope-from-placeholder": "Sender Envelope Email Address", - "from": "From", - "from-display-name": "Name for Sender", - "from-display-name-hint": "Info text regarding the name for sender.", - "from-display-name-placeholder": "Display Name for Sender Email Address", - "from-placeholder": "Sender Email Address", - "host": "Host", - "host-placeholder": "SMTP Host", - "port": "Port", - "reply-to": "Reply To", - "reply-to-display-name": "Name for Reply To", - "reply-to-display-name-placeholder": "Display Name for Reply To Email Address", - "reply-to-placeholder": "Reply To Email Address", - "ssl": "Enable SSL", - "starttls": "Enable StartTLS" - }, - "general": { - "form": { - "forgot-password": "Show Forgot password link on Login screen" - }, - "subtitle": "", - "title": "General Configurations" - }, - "subtitle": "SMTP (Simple Mail Transfer Protocol) enables you to send your emails through the specified server settings.", - "test": { - "error": "Test email could not be sent! Please revise the email address.", - "success": "Test email was sent successfully!" - }, - "title": "Configure SMTP Account" - }, "time": { "days": "{days} {days, plural, one{day} other{days}}", "hours": "{hours} {hours, plural, one{hour} other{hours}}", From d49b20b712041b907250bb31247d3294b0e3dc4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 27 Jul 2021 15:27:56 +0300 Subject: [PATCH 25/25] Some fixes --- .../license-information-screen.component.ts | 3 ++- .../dossier-listing-screen.component.ts | 10 +++++----- .../search-screen/search-screen.component.html | 2 +- .../search-screen/search-screen.component.ts | 13 +++++++------ .../page-header/page-header.component.html | 8 ++++---- .../table-header/table-header.component.html | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) 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 a9f9c95fa..112675cae 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 @@ -7,6 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { LoadingService } from '@services/loading.service'; import { ButtonConfig } from '@shared/components/page-header/models/button-config.model'; import { IconButtonTypes } from '@shared/components/buttons/icon-button/icon-button.component'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; @Component({ selector: 'redaction-license-information-screen', @@ -35,7 +36,7 @@ export class LicenseInformationScreenComponent implements OnInit { }; buttonConfigs: ButtonConfig[] = [ { - label: this._translateService.instant('license-info-screen.email-report'), + label: _('license-info-screen.email-report'), action: () => this.sendMail(), type: IconButtonTypes.PRIMARY } 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 24e1bcf50..b77729f18 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 @@ -47,7 +47,7 @@ export class DossierListingScreenComponent readonly itemSize = 95; buttonConfigs: ButtonConfig[] = [ { - label: this._translateService.instant('dossier-listing.add-new'), + label: _('dossier-listing.add-new'), action: () => this.openAddDossierDialog(), hide: !this.permissionsService.isManager(), icon: 'red:plus', @@ -56,19 +56,19 @@ export class DossierListingScreenComponent ]; tableColConfigs: TableColConfig[] = [ { - label: this._translateService.instant('dossier-listing.table-col-names.name'), + label: _('dossier-listing.table-col-names.name'), withSort: true, column: 'dossierName' }, { - label: this._translateService.instant('dossier-listing.table-col-names.needs-work') + label: _('dossier-listing.table-col-names.needs-work') }, { - label: this._translateService.instant('dossier-listing.table-col-names.owner'), + label: _('dossier-listing.table-col-names.owner'), class: 'user-column' }, { - label: this._translateService.instant('dossier-listing.table-col-names.status'), + label: _('dossier-listing.table-col-names.status'), class: 'flex-end' } ]; diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html index 9188f1344..ffa974b0a 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html @@ -62,7 +62,7 @@ [config]="[ { color: item.status, - label: item.status | translate, + label: fileStatusTranslations[item.status] | translate, length: 1, cssClass: 'all-caps-label' } diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts index a73654db7..f705e2497 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts @@ -11,9 +11,9 @@ import { ScreenStateService } from '../../../shared/services/screen-state.servic import { SortingService } from '../../../../services/sorting.service'; import { AppStateService } from '../../../../state/app-state.service'; import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; -import { TranslateService } from '@ngx-translate/core'; import { LoadingService } from '../../../../services/loading.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { fileStatusTranslations } from '../../translations/file-status-translations'; interface ListItem { fileName: string; @@ -32,6 +32,8 @@ interface ListItem { providers: [FilterService, SearchService, ScreenStateService, SortingService] }) export class SearchScreenComponent extends BaseListingComponent implements OnDestroy { + fileStatusTranslations = fileStatusTranslations; + readonly itemSize = 85; readonly search$ = new BehaviorSubject(null); readonly searchResults$: Observable = this.search$.asObservable().pipe( @@ -43,16 +45,16 @@ export class SearchScreenComponent extends BaseListingComponent implem ); readonly tableColConfigs: TableColConfig[] = [ { - label: this._translateService.instant('search-screen.cols.document') + label: _('search-screen.cols.document') }, { - label: this._translateService.instant('search-screen.cols.status') + label: _('search-screen.cols.status') }, { - label: this._translateService.instant('search-screen.cols.dossier') + label: _('search-screen.cols.dossier') }, { - label: this._translateService.instant('search-screen.cols.pages') + label: _('search-screen.cols.pages') } ]; protected readonly _primaryKey = 'fileName'; @@ -64,7 +66,6 @@ export class SearchScreenComponent extends BaseListingComponent implem private readonly _searchControllerService: SearchControllerService, private readonly _activatedRoute: ActivatedRoute, private readonly _appStateService: AppStateService, - private readonly _translateService: TranslateService, private readonly _loadingService: LoadingService, private readonly _router: Router ) { diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index 04eb13716..696c58c36 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -1,8 +1,8 @@