Skip to content

Commit

Permalink
fix change after detection error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yicong-Huang committed Jun 15, 2023
1 parent 5ea2e08 commit 35cc4c1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe("OperatorPropertyEditFrameComponent", () => {
fixture.detectChanges();
expect(component.operatorVersion).toEqual(mockResultPredicate.operatorVersion);

// check scan opeartor version
// check scan operator version
workflowActionService.addOperator(mockScanPredicate, mockPoint);
component.ngOnChanges({
currentOperatorId: new SimpleChange(undefined, mockScanPredicate.operatorID, true),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core";
import {
AfterViewChecked,
ChangeDetectorRef,
Component,
Input,
OnChanges,
OnDestroy,
OnInit,
SimpleChanges
} from "@angular/core";
import { ExecuteWorkflowService } from "../../../service/execute-workflow/execute-workflow.service";
import { WorkflowStatusService } from "../../../service/workflow-status/workflow-status.service";
import { Subject } from "rxjs";
import { AbstractControl, FormGroup, ValidationErrors } from "@angular/forms";
import { AbstractControl, FormGroup } from "@angular/forms";
import { FormlyFieldConfig, FormlyFormOptions } from "@ngx-formly/core";
import Ajv from "ajv";
import { FormlyJsonschema } from "@ngx-formly/core/json-schema";
Expand Down Expand Up @@ -79,7 +88,7 @@ Quill.register("modules/cursors", QuillCursors);
templateUrl: "./operator-property-edit-frame.component.html",
styleUrls: ["./operator-property-edit-frame.component.scss"],
})
export class OperatorPropertyEditFrameComponent implements OnInit, OnChanges, OnDestroy {
export class OperatorPropertyEditFrameComponent implements OnInit, OnChanges, OnDestroy, AfterViewChecked {
@Input() currentOperatorId?: string;

currentOperatorSchema?: OperatorSchema;
Expand Down Expand Up @@ -153,6 +162,10 @@ export class OperatorPropertyEditFrameComponent implements OnInit, OnChanges, On
this.rerenderEditorForm();
}

ngAfterViewChecked(): void {
this.changeDetectorRef.detectChanges();
}

switchDisplayComponent(targetConfig?: PropertyDisplayComponentConfig) {
if (
this.extraDisplayComponentConfig?.component === targetConfig?.component &&
Expand Down

0 comments on commit 35cc4c1

Please sign in to comment.