Skip to content

Commit

Permalink
Fixed styling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-François Morin committed Feb 23, 2024
1 parent e2bf9d2 commit 1cea469
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export class FilteredCollectionsComponent {
getFilteredCollections(): Observable<RawRestResponse> {
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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,22 @@ export class FilteredItemsComponent {
getFilteredItems(): Observable<RawRestResponse> {
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) {

Check failure on line 307 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype

Check failure on line 307 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype
params += `&collections=${colls[coll]}`;
}

let preds = this.queryForm.value['queryPredicates'];
let preds = this.queryForm.value.queryPredicates;
for (const pred in preds) {

Check failure on line 312 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype

Check failure on line 312 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype
const field = preds[pred].field;
const op = preds[pred].operator;
Expand All @@ -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) {

Check failure on line 328 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype

Check failure on line 328 in src/app/admin/admin-reports/filtered-items/filtered-items.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype
params += `&additionalFields=${addFlds[fld]}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

}

0 comments on commit 1cea469

Please sign in to comment.