From 9a85d54990d43de75e420e376ac0464c652f829c Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 6 Oct 2021 16:23:07 +0300 Subject: [PATCH] cast objects, find bugs --- .../downloads-list-screen.component.html | 4 +- .../active-fields-listing.component.html | 4 +- .../screens/audit/audit-screen.component.html | 4 +- .../default-colors-screen.component.html | 4 +- .../dictionary-listing-screen.component.html | 4 +- ...r-attributes-listing-screen.component.html | 4 +- ...er-templates-listing-screen.component.html | 6 +-- ...sier-templates-listing-screen.component.ts | 51 ++++++++----------- ...e-attributes-listing-screen.component.html | 4 +- .../screens/trash/trash-screen.component.html | 2 +- .../user-listing-screen.component.html | 4 +- ...t-dossier-deleted-documents.component.html | 4 +- .../dossier-overview-screen.component.html | 10 ++-- .../search-screen.component.html | 4 +- .../services/dossier-templates.service.ts | 6 ++- 15 files changed, 56 insertions(+), 59 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 5a41656d3..83dacdb5f 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 @@ -24,8 +24,8 @@ > - -
+ +
{{ 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 75474415d..6166ee55d 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 @@ -53,8 +53,8 @@ - -
+ +
- -
+ +
{{ log.message }}
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 5ede13e02..1fb70d6d1 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 @@ -25,8 +25,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 558a8ffb3..305353c0b 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 @@ -77,8 +77,8 @@
- -
+ +
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 6a2c78c77..c10ed9f52 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,8 +64,8 @@
- -
+ +
{{ attribute.label }}
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 e77956dfd..6dd34eda0 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 @@ -38,7 +38,7 @@ @@ -61,8 +61,8 @@
- -
+ +
{{ dossierTemplate.name }} 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 90609213e..8172592dd 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 @@ -13,7 +13,6 @@ import { TableColumnConfig, Toaster, } from '@iqser/common-ui'; -import { DossierTemplateControllerService } from '@redaction/red-ui-http'; import { UserService } from '@services/user.service'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { RouterHistoryService } from '@services/router-history.service'; @@ -42,22 +41,21 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent { - this.loadDossierTemplatesData(); + this.loadDossierTemplateStats(); }); } - private async _deleteTemplates(templateIds = this.listingService.selected.map(d => d.dossierTemplateId)) { - await this._dossierTemplateControllerService - .deleteDossierTemplates(templateIds) - .toPromise() - .catch(error => { - if (error.status === 409) { - this._toaster.error(_('dossier-templates-listing.error.conflict')); - } else { - this._toaster.error(_('dossier-templates-listing.error.generic')); - } - }); - this.listingService.setSelected([]); - await this._dossierTemplatesService.loadAll().toPromise(); - await this._appStateService.loadDictionaryData(); - this.loadDossierTemplatesData(); - } - - private _loadDossierTemplateStats() { + loadDossierTemplateStats() { this.entitiesService.all.forEach(rs => { const dictionaries = this._appStateService.dictionaryData[rs.dossierTemplateId]; if (dictionaries) { @@ -107,4 +83,21 @@ export class DossierTemplatesListingScreenComponent extends ListingComponent d.dossierTemplateId)) { + await this._dossierTemplatesService + .delete(templateIds) + .toPromise() + .catch(error => { + if (error.status === 409) { + this._toaster.error(_('dossier-templates-listing.error.conflict')); + } else { + this._toaster.error(_('dossier-templates-listing.error.generic')); + } + }); + this.listingService.setSelected([]); + await this._dossierTemplatesService.loadAll().toPromise(); + await this._appStateService.loadDictionaryData(); + this.loadDossierTemplateStats(); + } } 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 b8e64640f..3d61c2211 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 @@ -74,8 +74,8 @@
- -
+ +
{{ attribute.label }}
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 2b2573d95..06bc796ac 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 @@ -41,7 +41,7 @@ -
+
{{ entity.dossierName }} 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 6a76d1768..f78e18ef5 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 @@ -65,8 +65,8 @@ > - -
+ +
diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html index af2998b79..08ab20e7f 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.html @@ -34,8 +34,8 @@ > - -
+ +
{{ file.filename }}
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 69bf6ca42..32bc35237 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 @@ -121,8 +121,8 @@ > - -
+ +
@@ -143,15 +143,15 @@
- -
+ +
{{ file.numberOfPages }}
- {{ file.excludedPagesCount }} + {{ file.excludedPages.length }}
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 65076d3c2..e261dcdbb 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 @@ -21,8 +21,8 @@
- -
+ +
this.all), ); } + + delete(body: List): Observable { + return super.delete(body, `${this._defaultModelPath}/delete`); + } }