From 1cea4690dad9f220a8017dfe08fdf29e673003f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Morin?= Date: Fri, 23 Feb 2024 16:49:48 -0500 Subject: [PATCH] Fixed styling errors --- .../filtered-collections.component.ts | 6 ++-- .../filtered-items.component.ts | 12 +++---- .../filters-section.component.ts | 32 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts index 411e362d29c..059b65ab8ef 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts @@ -52,15 +52,15 @@ export class FilteredCollectionsComponent { getFilteredCollections(): Observable { let params = this.toQueryString(); if (params.length > 0) { - params = "?" + params; + params = `?${params}`; } let scheme = environment.rest.ssl ? 'https' : 'http'; let urlRestApp = `${scheme}://${environment.rest.host}:${environment.rest.port}${environment.rest.nameSpace}`; return this.restService.request(RestRequestMethod.GET, `${urlRestApp}/api/contentreport/filteredcollections${params}`); } - private toQueryString() : string { - let params = FiltersComponent.toQueryString(this.queryForm.value['filters']); + private toQueryString(): string { + let params = FiltersComponent.toQueryString(this.queryForm.value.filters); return params; } diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts index 3d1db452fdf..af8c9d6aa5c 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts @@ -293,22 +293,22 @@ export class FilteredItemsComponent { getFilteredItems(): Observable { let params = this.toQueryString(); if (params.length > 0) { - params = "?" + params; + params = `?${params}`; } let scheme = environment.rest.ssl ? 'https' : 'http'; let urlRestApp = `${scheme}://${environment.rest.host}:${environment.rest.port}${environment.rest.nameSpace}`; return this.restService.request(RestRequestMethod.GET, `${urlRestApp}/api/contentreport/filtereditems${params}`); } - private toQueryString() : string { + private toQueryString(): string { let params = `page=${this.currentPage}&size=${this.pageSize()}`; - let colls = this.queryForm.value['collections']; + let colls = this.queryForm.value.collections; for (const coll in colls) { params += `&collections=${colls[coll]}`; } - let preds = this.queryForm.value['queryPredicates']; + let preds = this.queryForm.value.queryPredicates; for (const pred in preds) { const field = preds[pred].field; const op = preds[pred].operator; @@ -319,12 +319,12 @@ export class FilteredItemsComponent { } } - let filters = FiltersComponent.toQueryString(this.queryForm.value['filters']); + let filters = FiltersComponent.toQueryString(this.queryForm.value.filters); if (filters.length > 0) { params += `&${filters}`; } - let addFlds = this.queryForm.value['additionalFields']; + let addFlds = this.queryForm.value.additionalFields; for (const fld in addFlds) { params += `&additionalFields=${addFlds[fld]}`; } diff --git a/src/app/admin/admin-reports/filters-section/filters-section.component.ts b/src/app/admin/admin-reports/filters-section/filters-section.component.ts index 2c3af281c0d..cc0d535cd70 100644 --- a/src/app/admin/admin-reports/filters-section/filters-section.component.ts +++ b/src/app/admin/admin-reports/filters-section/filters-section.component.ts @@ -99,6 +99,22 @@ export class FiltersComponent { return undefined; } + static toQueryString(filters: Object): string { + let params = ''; + let first = true; + for (const key in filters) { + if (filters[key]) { + if (first) { + first = false; + } else { + params += '&'; + } + params += `filters=${key}`; + } + } + return params; + } + allFilters(): FilterGroup[] { return FiltersComponent.FILTERS; } @@ -126,20 +142,4 @@ export class FiltersComponent { this.setAllFilters(false); } - static toQueryString(filters: Object): string { - let params = ''; - let first = true; - for (const key in filters) { - if (filters[key]) { - if (first) { - first = false; - } else { - params += '&'; - } - params += `filters=${key}`; - } - } - return params; - } - }