Fix getAlarms permissions. Fix entities tables persistent page link. Improve details button in autocomplete.
This commit is contained in:
parent
275fda0a37
commit
1c2f357585
@ -229,7 +229,7 @@ public class AlarmController extends BaseController {
|
|||||||
@ApiOperation(value = "Get Alarms (getAlarms)",
|
@ApiOperation(value = "Get Alarms (getAlarms)",
|
||||||
notes = "Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " +
|
notes = "Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " +
|
||||||
PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
|
PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
|
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
|
||||||
@RequestMapping(value = "/alarm/{entityType}/{entityId}", method = RequestMethod.GET)
|
@RequestMapping(value = "/alarm/{entityType}/{entityId}", method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public PageData<AlarmInfo> getAlarms(
|
public PageData<AlarmInfo> getAlarms(
|
||||||
|
|||||||
@ -172,6 +172,7 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
|||||||
private init(entitiesTableConfig: EntityTableConfig<BaseData<HasId>>) {
|
private init(entitiesTableConfig: EntityTableConfig<BaseData<HasId>>) {
|
||||||
this.isDetailsOpen = false;
|
this.isDetailsOpen = false;
|
||||||
this.entitiesTableConfig = entitiesTableConfig;
|
this.entitiesTableConfig = entitiesTableConfig;
|
||||||
|
this.pageMode = this.entitiesTableConfig.pageMode;
|
||||||
if (this.entitiesTableConfig.headerComponent) {
|
if (this.entitiesTableConfig.headerComponent) {
|
||||||
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.entitiesTableConfig.headerComponent);
|
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.entitiesTableConfig.headerComponent);
|
||||||
const viewContainerRef = this.entityTableHeaderAnchor.viewContainerRef;
|
const viewContainerRef = this.entityTableHeaderAnchor.viewContainerRef;
|
||||||
@ -233,7 +234,6 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
|||||||
|
|
||||||
this.displayPagination = this.entitiesTableConfig.displayPagination;
|
this.displayPagination = this.entitiesTableConfig.displayPagination;
|
||||||
this.defaultPageSize = this.entitiesTableConfig.defaultPageSize;
|
this.defaultPageSize = this.entitiesTableConfig.defaultPageSize;
|
||||||
this.pageMode = this.entitiesTableConfig.pageMode;
|
|
||||||
this.pageSizeOptions = [this.defaultPageSize, this.defaultPageSize * 2, this.defaultPageSize * 3];
|
this.pageSizeOptions = [this.defaultPageSize, this.defaultPageSize * 2, this.defaultPageSize * 3];
|
||||||
|
|
||||||
if (this.entitiesTableConfig.useTimePageLink) {
|
if (this.entitiesTableConfig.useTimePageLink) {
|
||||||
|
|||||||
@ -23,7 +23,11 @@
|
|||||||
[required]="required"
|
[required]="required"
|
||||||
(keydown)="deviceProfileEnter($event)"
|
(keydown)="deviceProfileEnter($event)"
|
||||||
(keypress)="deviceProfileEnter($event)"
|
(keypress)="deviceProfileEnter($event)"
|
||||||
[matAutocomplete]="deviceProfileAutocomplete">
|
[matAutocomplete]="deviceProfileAutocomplete"
|
||||||
|
[fxShow]="!showDetailsPageLink || !disabled || !selectDeviceProfileFormGroup.get('deviceProfile').value">
|
||||||
|
<a *ngIf="showDetailsPageLink && selectDeviceProfileFormGroup.get('deviceProfile').value && disabled" aria-label="Open tenant profile" [routerLink]=deviceProfileURL>
|
||||||
|
{{ displayDeviceProfileFn(selectDeviceProfileFormGroup.get('deviceProfile').value) }}
|
||||||
|
</a>
|
||||||
<button *ngIf="selectDeviceProfileFormGroup.get('deviceProfile').value && !disabled"
|
<button *ngIf="selectDeviceProfileFormGroup.get('deviceProfile').value && !disabled"
|
||||||
type="button"
|
type="button"
|
||||||
matSuffix mat-button mat-icon-button aria-label="Clear"
|
matSuffix mat-button mat-icon-button aria-label="Clear"
|
||||||
@ -38,13 +42,6 @@
|
|||||||
(click)="editDeviceProfile($event)">
|
(click)="editDeviceProfile($event)">
|
||||||
<mat-icon class="material-icons">edit</mat-icon>
|
<mat-icon class="material-icons">edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="showDetailsPageLink && selectDeviceProfileFormGroup.get('deviceProfile').value && disabled"
|
|
||||||
type="button"
|
|
||||||
matSuffix mat-button mat-icon-button aria-label="Open device profile">
|
|
||||||
<a [routerLink]=deviceProfileURL>
|
|
||||||
<mat-icon class="material-icons">open_in_new</mat-icon>
|
|
||||||
</a>
|
|
||||||
</button>
|
|
||||||
<mat-autocomplete
|
<mat-autocomplete
|
||||||
class="tb-autocomplete"
|
class="tb-autocomplete"
|
||||||
(closed)="onPanelClosed()"
|
(closed)="onPanelClosed()"
|
||||||
|
|||||||
@ -233,9 +233,9 @@ export class DeviceProfileAutocompleteComponent implements ControlValueAccessor,
|
|||||||
setDisabledState(isDisabled: boolean): void {
|
setDisabledState(isDisabled: boolean): void {
|
||||||
this.disabled = isDisabled;
|
this.disabled = isDisabled;
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
this.selectDeviceProfileFormGroup.disable();
|
this.selectDeviceProfileFormGroup.disable({emitEvent: false});
|
||||||
} else {
|
} else {
|
||||||
this.selectDeviceProfileFormGroup.enable();
|
this.selectDeviceProfileFormGroup.enable({emitEvent: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,11 @@
|
|||||||
[required]="required"
|
[required]="required"
|
||||||
(keydown)="tenantProfileEnter($event)"
|
(keydown)="tenantProfileEnter($event)"
|
||||||
(keypress)="tenantProfileEnter($event)"
|
(keypress)="tenantProfileEnter($event)"
|
||||||
[matAutocomplete]="tenantProfileAutocomplete">
|
[matAutocomplete]="tenantProfileAutocomplete"
|
||||||
|
[fxShow]="!showDetailsPageLink || !disabled || !selectTenantProfileFormGroup.get('tenantProfile').value">
|
||||||
|
<a *ngIf="showDetailsPageLink && selectTenantProfileFormGroup.get('tenantProfile').value && disabled" aria-label="Open tenant profile" [routerLink]=tenantProfileURL>
|
||||||
|
{{ displayTenantProfileFn(selectTenantProfileFormGroup.get('tenantProfile').value) }}
|
||||||
|
</a>
|
||||||
<button *ngIf="selectTenantProfileFormGroup.get('tenantProfile').value && !disabled"
|
<button *ngIf="selectTenantProfileFormGroup.get('tenantProfile').value && !disabled"
|
||||||
type="button"
|
type="button"
|
||||||
matSuffix mat-button mat-icon-button aria-label="Clear"
|
matSuffix mat-button mat-icon-button aria-label="Clear"
|
||||||
@ -38,13 +42,6 @@
|
|||||||
(click)="editTenantProfile($event)">
|
(click)="editTenantProfile($event)">
|
||||||
<mat-icon class="material-icons">edit</mat-icon>
|
<mat-icon class="material-icons">edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="showDetailsPageLink && selectTenantProfileFormGroup.get('tenantProfile').value && disabled"
|
|
||||||
type="button"
|
|
||||||
matSuffix mat-button mat-icon-button aria-label="Open device profile">
|
|
||||||
<a [routerLink]=tenantProfileURL>
|
|
||||||
<mat-icon class="material-icons">open_in_new</mat-icon>
|
|
||||||
</a>
|
|
||||||
</button>
|
|
||||||
<mat-autocomplete
|
<mat-autocomplete
|
||||||
class="tb-autocomplete"
|
class="tb-autocomplete"
|
||||||
#tenantProfileAutocomplete="matAutocomplete"
|
#tenantProfileAutocomplete="matAutocomplete"
|
||||||
|
|||||||
@ -139,9 +139,9 @@ export class TenantProfileAutocompleteComponent implements ControlValueAccessor,
|
|||||||
setDisabledState(isDisabled: boolean): void {
|
setDisabledState(isDisabled: boolean): void {
|
||||||
this.disabled = isDisabled;
|
this.disabled = isDisabled;
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
this.selectTenantProfileFormGroup.disable();
|
this.selectTenantProfileFormGroup.disable({emitEvent: false});
|
||||||
} else {
|
} else {
|
||||||
this.selectTenantProfileFormGroup.enable();
|
this.selectTenantProfileFormGroup.enable({emitEvent: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<a mat-button routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: !section.notExact}" routerLink="{{section.path}}">
|
<a mat-button routerLinkActive="tb-active" [routerLinkActiveOptions]="{paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored'}" routerLink="{{section.path}}">
|
||||||
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
||||||
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
||||||
<span>{{section.name | translate}}</span>
|
<span>{{section.name | translate}}</span>
|
||||||
|
|||||||
@ -116,12 +116,14 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<tb-ota-package-autocomplete
|
<tb-ota-package-autocomplete
|
||||||
[useFullEntityId]="true"
|
[useFullEntityId]="true"
|
||||||
|
[showDetailsPageLink]="true"
|
||||||
[type]="otaUpdateType.FIRMWARE"
|
[type]="otaUpdateType.FIRMWARE"
|
||||||
[deviceProfileId]="entityForm.get('deviceProfileId').value?.id"
|
[deviceProfileId]="entityForm.get('deviceProfileId').value?.id"
|
||||||
formControlName="firmwareId">
|
formControlName="firmwareId">
|
||||||
</tb-ota-package-autocomplete>
|
</tb-ota-package-autocomplete>
|
||||||
<tb-ota-package-autocomplete
|
<tb-ota-package-autocomplete
|
||||||
[useFullEntityId]="true"
|
[useFullEntityId]="true"
|
||||||
|
[showDetailsPageLink]="true"
|
||||||
[type]="otaUpdateType.SOFTWARE"
|
[type]="otaUpdateType.SOFTWARE"
|
||||||
[deviceProfileId]="entityForm.get('deviceProfileId').value?.id"
|
[deviceProfileId]="entityForm.get('deviceProfileId').value?.id"
|
||||||
formControlName="softwareId">
|
formControlName="softwareId">
|
||||||
|
|||||||
@ -22,20 +22,17 @@
|
|||||||
(focusin)="onFocus()"
|
(focusin)="onFocus()"
|
||||||
[required]="required"
|
[required]="required"
|
||||||
[matAutocomplete]="packageAutocomplete"
|
[matAutocomplete]="packageAutocomplete"
|
||||||
[matAutocompleteDisabled]="disabled">
|
[matAutocompleteDisabled]="disabled"
|
||||||
|
[fxShow]="!showDetailsPageLink || !disabled || !otaPackageFormGroup.get('packageId').value">
|
||||||
|
<a *ngIf="showDetailsPageLink && otaPackageFormGroup.get('packageId').value && disabled" aria-label="Open ota package" [routerLink]=packageURL>
|
||||||
|
{{ displayPackageFn(otaPackageFormGroup.get('packageId').value) }}
|
||||||
|
</a>
|
||||||
<button *ngIf="otaPackageFormGroup.get('packageId').value && !disabled"
|
<button *ngIf="otaPackageFormGroup.get('packageId').value && !disabled"
|
||||||
type="button"
|
type="button"
|
||||||
matSuffix mat-button mat-icon-button aria-label="Clear"
|
matSuffix mat-button mat-icon-button aria-label="Clear"
|
||||||
(click)="clear()">
|
(click)="clear()">
|
||||||
<mat-icon class="material-icons">close</mat-icon>
|
<mat-icon class="material-icons">close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="showDetailsPageLink && otaPackageFormGroup.get('packageId').value && disabled"
|
|
||||||
type="button"
|
|
||||||
matSuffix mat-button mat-icon-button aria-label="Open ota package">
|
|
||||||
<a [routerLink]=packageURL>
|
|
||||||
<mat-icon class="material-icons">open_in_new</mat-icon>
|
|
||||||
</a>
|
|
||||||
</button>
|
|
||||||
<mat-autocomplete class="tb-autocomplete"
|
<mat-autocomplete class="tb-autocomplete"
|
||||||
#packageAutocomplete="matAutocomplete"
|
#packageAutocomplete="matAutocomplete"
|
||||||
[displayWith]="displayPackageFn">
|
[displayWith]="displayPackageFn">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user