Browse Source

move events modal to reusable component

pull/14513/head
Maksym Tsymbarov 9 months ago
parent
commit
185ef9b53b
  1. 8
      ui-ngx/src/app/modules/home/components/event/events-dialog.component.html
  2. 0
      ui-ngx/src/app/modules/home/components/event/events-dialog.component.scss
  3. 19
      ui-ngx/src/app/modules/home/components/event/events-dialog.component.ts
  4. 5
      ui-ngx/src/app/modules/home/components/home-components.module.ts
  5. 8
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  6. 4
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.module.ts

8
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-debug-dialog.component.html → ui-ngx/src/app/modules/home/components/event/events-dialog.component.html

@ -17,7 +17,7 @@
-->
<div class="debug-dialog-container flex flex-col xs:h-full">
<mat-toolbar color="primary">
<h2>{{ 'rulenode.events' | translate}}</h2>
<h2>{{ data.title | translate}}</h2>
<span class="flex-1"></span>
<button mat-icon-button
(click)="cancel()"
@ -29,10 +29,10 @@
<tb-event-table
[debugEventTypes]="[debugEventTypes.DEBUG_RULE_NODE]"
[defaultEventType]="debugEventTypes.DEBUG_RULE_NODE"
[active]="data.isActive"
[active]="true"
[tenantId]="data.tenantId.id"
[entityId]="data.ruleNodeId"
[functionTestButtonLabel]="data.ruleNodeTestButtonLabel"
[entityId]="data.entityId"
[functionTestButtonLabel]="data.functionTestButtonLabel"
(debugEventSelected)="data.onDebugEventSelected"
/>
</div>

0
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-debug-dialog.component.scss → ui-ngx/src/app/modules/home/components/event/events-dialog.component.scss

19
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-debug-dialog.component.ts → ui-ngx/src/app/modules/home/components/event/events-dialog.component.ts

@ -26,32 +26,29 @@ import { TenantId } from '@shared/models/id/tenant-id';
import { EntityId } from '@shared/models/id/entity-id';
export interface RuleNodeDebugDialogData {
isActive: boolean;
title: string;
tenantId: TenantId;
ruleNodeId: EntityId;
ruleNodeTestButtonLabel: string;
entityId: EntityId;
functionTestButtonLabel: string;
onDebugEventSelected: ()=> void;
}
@Component({
selector: 'tb-rule-node-debug-dialog',
templateUrl: './rule-node-debug-dialog.component.html',
styleUrl: './rule-node-debug-dialog.component.scss'
selector: 'tb-debug-dialog',
templateUrl: './events-dialog.component.html',
styleUrl: './events-dialog.component.scss'
})
export class RuleNodeDebugDialogComponent extends DialogComponent<RuleNodeDebugDialogComponent, string> implements AfterViewInit{
export class EventsDialogComponent extends DialogComponent<EventsDialogComponent, string> implements AfterViewInit{
@ViewChild(EventTableComponent, {static: true}) eventsTable: EventTableComponent;
readonly DebugEventType = DebugEventType;
readonly debugEventTypes = DebugEventType;
readonly EventType = EventType;
dialogTitle: string;
constructor(protected store: Store<AppState>,
protected router: Router,
@Inject(MAT_DIALOG_DATA) public data: RuleNodeDebugDialogData,
protected dialogRef: MatDialogRef<RuleNodeDebugDialogComponent, string>) {
protected dialogRef: MatDialogRef<EventsDialogComponent, string>) {
super(store, router, dialogRef);
}

5
ui-ngx/src/app/modules/home/components/home-components.module.ts

@ -204,6 +204,7 @@ import { EditApiKeyDescriptionPanelComponent } from '@home/components/api-key/ed
import { ApiKeyGeneratedDialogComponent } from '@home/components/api-key/api-key-generated-dialog.component';
import { ApiKeysTableDialogComponent } from '@home/components/api-key/api-keys-table-dialog.component';
import { AuditLogFilterComponent } from "@home/components/audit-log/audit-log-filter.component";
import { EventsDialogComponent } from '@home/components/event/events-dialog.component';
@NgModule({
declarations:
@ -361,7 +362,8 @@ import { AuditLogFilterComponent } from "@home/components/audit-log/audit-log-fi
EditApiKeyDescriptionPanelComponent,
ApiKeyGeneratedDialogComponent,
AuditLogHeaderComponent,
AuditLogFilterComponent
AuditLogFilterComponent,
EventsDialogComponent
],
imports: [
CommonModule,
@ -510,6 +512,7 @@ import { AuditLogFilterComponent } from "@home/components/audit-log/audit-log-fi
ResourcesLibraryComponent,
ApiKeysTableComponent,
ApiKeysTableDialogComponent,
EventsDialogComponent
],
providers: [
WidgetComponentService,

8
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -100,7 +100,7 @@ import { EntityDebugSettings } from '@shared/models/entity.models';
import Timeout = NodeJS.Timeout;
import { DomSanitizer } from '@angular/platform-browser';
import { AdditionalDebugActionConfig } from '@home/components/entity/debug/entity-debug-settings.model';
import { RuleNodeDebugDialogComponent } from '@home/pages/rulechain/rule-node-debug-dialog.component';
import { EventsDialogComponent } from '@home/components/event/events-dialog.component';
@Component({
selector: 'tb-rulechain-page',
@ -1674,13 +1674,13 @@ export class RuleChainPageComponent extends PageComponent
}
private openDebugEventsDialog(): void {
this.dialog.open<RuleNodeDebugDialogComponent>(RuleNodeDebugDialogComponent, {
this.dialog.open<EventsDialogComponent>(EventsDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
active: true,
title: 'rulenode.events',
tenantId: this.ruleChain.tenantId,
ruleNodeId: this.editingRuleNode.ruleNodeId,
entityId: this.editingRuleNode.ruleNodeId,
functionTestButtonLabel: this.ruleNodeTestButtonLabel,
debugEventSelected: this.onDebugEventSelected.bind(this)
}

4
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.module.ts

@ -33,7 +33,6 @@ import { RuleNodeDetailsComponent } from '@home/pages/rulechain/rule-node-detail
import { RuleNodeConfigComponent } from '@home/pages/rulechain/rule-node-config.component';
import { LinkLabelsComponent } from '@home/pages/rulechain/link-labels.component';
import { RuleNodeLinkComponent } from '@home/pages/rulechain/rule-node-link.component';
import { RuleNodeDebugDialogComponent } from '@home/pages/rulechain/rule-node-debug-dialog.component';
@NgModule({
declarations: [
@ -44,8 +43,7 @@ import { RuleNodeDebugDialogComponent } from '@home/pages/rulechain/rule-node-de
RuleNodeConfigComponent,
AddRuleNodeLinkDialogComponent,
AddRuleNodeDialogComponent,
CreateNestedRuleChainDialogComponent,
RuleNodeDebugDialogComponent
CreateNestedRuleChainDialogComponent
],
imports: [
CommonModule,

Loading…
Cancel
Save