Browse Source

fix(iot-hub): include peOnly and tbVersion in filter info and widget categories requests

- getFilterInfo and getWidgetCategories now append peOnly=false and tbVersion=<computed> to the URL, matching getPublishedVersions behavior
- add-item dialog content: scope max-height: 70vh to mat-gt-sm
pull/15508/head
Igor Kulikov 5 months ago
parent
commit
c153d06657
  1. 17
      ui-ngx/src/app/core/http/iot-hub-api.service.ts
  2. 2
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-add-item-dialog.component.scss

17
ui-ngx/src/app/core/http/iot-hub-api.service.ts

@ -86,25 +86,24 @@ export class IotHubApiService {
}
public getFilterInfo(itemType: ItemType, config?: IotHubRequestConfig): Observable<ItemTypeFilterInfo> {
return this.http.get<ItemTypeFilterInfo>(
`${this.baseUrl}/api/item-listing/filterInfo/${itemType}`,
{ params: this.buildParams(config) }
);
const url = `${this.baseUrl}/api/item-listing/filterInfo/${itemType}`
+ `?peOnly=false&tbVersion=${tbVersionToInt(env.tbVersion)}`;
return this.http.get<ItemTypeFilterInfo>(url, { params: this.buildParams(config) });
}
public getWidgetCategories(textSearch?: string, scadaFirst?: boolean,
config?: IotHubRequestConfig): Observable<WidgetCategory[]> {
let url = `${this.baseUrl}/api/item-listing/widgetCategories`;
const queryParams: string[] = [];
const queryParams: string[] = [
`peOnly=false`,
`tbVersion=${tbVersionToInt(env.tbVersion)}`
];
if (textSearch?.trim()) {
queryParams.push(`textSearch=${encodeURIComponent(textSearch.trim())}`);
}
if (scadaFirst != null) {
queryParams.push(`scadaFirst=${scadaFirst}`);
}
if (queryParams.length) {
url += `?${queryParams.join('&')}`;
}
const url = `${this.baseUrl}/api/item-listing/widgetCategories?${queryParams.join('&')}`;
return this.http.get<WidgetCategory[]>(url, { params: this.buildParams(config) });
}

2
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-add-item-dialog.component.scss

@ -22,7 +22,6 @@
padding: 0;
overflow-x: hidden;
height: 70vh;
max-height: 70vh;
tb-iot-hub-browse {
height: 100%;
@ -30,6 +29,7 @@
@media #{$mat-gt-sm} {
width: 80vw;
max-height: 70vh;
}
@media #{$mat-gt-md} {

Loading…
Cancel
Save