Browse Source

Merge pull request #14371 from ArtemDzhereleiko/AD/bug-fix/copy-alarm-rule-and-filter

Fixed copy alarm rule and filter and remove alarm tab for tenant and tenant profile for sysadmin
pull/14383/head
Vladyslav Prykhodko 10 months ago
committed by GitHub
parent
commit
8fe19a9918
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts
  2. 38
      ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profile-tabs.component.html
  3. 54
      ui-ngx/src/app/modules/home/pages/tenant/tenant-tabs.component.html
  4. 2
      ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts

2
ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rules-table-config.ts

@ -224,7 +224,7 @@ export class AlarmRulesTableConfig extends EntityTableConfig<any> {
private copyCalculatedField(calculatedField: CalculatedField, isDirty = false): void { private copyCalculatedField(calculatedField: CalculatedField, isDirty = false): void {
const copyCalculatedAlarmRule = deepClone(calculatedField); const copyCalculatedAlarmRule = deepClone(calculatedField);
copyCalculatedAlarmRule.entityId = null; copyCalculatedAlarmRule.entityId = null;
this.getCalculatedAlarmDialog(calculatedField, 'action.apply', isDirty) this.getCalculatedAlarmDialog(copyCalculatedAlarmRule, 'action.apply', isDirty)
.subscribe((res) => { .subscribe((res) => {
if (res) { if (res) {
this.updateData(); this.updateData();

38
ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profile-tabs.component.html

@ -15,24 +15,20 @@
limitations under the License. limitations under the License.
--> -->
<mat-tab *ngIf="entity" @if (entity) {
label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab"> <mat-tab label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab">
<tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE" <tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE"
[active]="attributesTab.isActive" [active]="attributesTab.isActive"
[entityId]="entity.id" [entityId]="entity.id"
[entityName]="entity.name"> [entityName]="entity.name">
</tb-attribute-table> </tb-attribute-table>
</mat-tab> </mat-tab>
<mat-tab *ngIf="entity" <mat-tab label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab">
label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab"> <tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY"
<tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY" disableAttributeScopeSelection
disableAttributeScopeSelection [active]="telemetryTab.isActive"
[active]="telemetryTab.isActive" [entityId]="entity.id"
[entityId]="entity.id" [entityName]="entity.name">
[entityName]="entity.name"> </tb-attribute-table>
</tb-attribute-table> </mat-tab>
</mat-tab> }
<mat-tab *ngIf="entity"
label="{{ 'alarm.alarms' | translate }}" #alarmsTab="matTab">
<tb-alarm-table [active]="alarmsTab.isActive" [entityId]="entity.id"></tb-alarm-table>
</mat-tab>

54
ui-ngx/src/app/modules/home/pages/tenant/tenant-tabs.component.html

@ -15,33 +15,27 @@
limitations under the License. limitations under the License.
--> -->
<mat-tab *ngIf="entity" @if (entity) {
label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab"> <mat-tab label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab">
<tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE" <tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE"
[active]="attributesTab.isActive" [active]="attributesTab.isActive"
[entityId]="entity.id" [entityId]="entity.id"
[entityName]="entity.name"> [entityName]="entity.name">
</tb-attribute-table> </tb-attribute-table>
</mat-tab> </mat-tab>
<mat-tab *ngIf="entity" <mat-tab label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab">
label="{{ 'attribute.latest-telemetry' | translate }}" #telemetryTab="matTab"> <tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY"
<tb-attribute-table [defaultAttributeScope]="latestTelemetryTypes.LATEST_TELEMETRY" disableAttributeScopeSelection
disableAttributeScopeSelection [active]="telemetryTab.isActive"
[active]="telemetryTab.isActive" [entityId]="entity.id"
[entityId]="entity.id" [entityName]="entity.name">
[entityName]="entity.name"> </tb-attribute-table>
</tb-attribute-table> </mat-tab>
</mat-tab> <mat-tab label="{{ 'tenant.events' | translate }}" #eventsTab="matTab">
<mat-tab *ngIf="entity" <tb-event-table [defaultEventType]="eventTypes.ERROR" [active]="eventsTab.isActive" [tenantId]="nullUid"
label="{{ 'alarm.alarms' | translate }}" #alarmsTab="matTab"> [entityId]="entity.id"></tb-event-table>
<tb-alarm-table [active]="alarmsTab.isActive" [entityId]="entity.id"></tb-alarm-table> </mat-tab>
</mat-tab> <mat-tab label="{{ 'relation.relations' | translate }}" #relationsTab="matTab">
<mat-tab *ngIf="entity" <tb-relation-table [active]="relationsTab.isActive" [entityId]="entity.id"></tb-relation-table>
label="{{ 'tenant.events' | translate }}" #eventsTab="matTab"> </mat-tab>
<tb-event-table [defaultEventType]="eventTypes.ERROR" [active]="eventsTab.isActive" [tenantId]="nullUid" }
[entityId]="entity.id"></tb-event-table>
</mat-tab>
<mat-tab *ngIf="entity"
label="{{ 'relation.relations' | translate }}" #relationsTab="matTab">
<tb-relation-table [active]="relationsTab.isActive" [entityId]="entity.id"></tb-relation-table>
</mat-tab>

2
ui-ngx/src/app/shared/components/entity/entity-subtype-list.component.ts

@ -299,7 +299,7 @@ export class EntitySubTypeListComponent implements ControlValueAccessor, OnInit,
} }
selected(event: MatAutocompleteSelectedEvent): void { selected(event: MatAutocompleteSelectedEvent): void {
this.add(event.option.viewValue); this.add(event.option.value);
this.clear(''); this.clear('');
} }

Loading…
Cancel
Save