Skip to content

Commit

Permalink
fix: angular build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abuaboud committed Aug 12, 2024
1 parent a39e7f9 commit b5c7b54
Showing 1 changed file with 3 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApEdition } from '@activepieces/shared';
import { FlagService, HighlightService } from '@activepieces/ui/common';
import { FlagService } from '@activepieces/ui/common';
import { CodeService } from '@activepieces/ui/feature-builder-store';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -50,7 +50,6 @@ export class CodeWriterDialogComponent {
private dialogRef: MatDialogRef<CodeWriterDialogComponent>,
private codeWriterService: CodeWriterService,
private flagService: FlagService,
private highlightService: HighlightService,
@Inject(MAT_DIALOG_DATA)
public data: CodeWriterDialogData,
private codeService: CodeService
Expand Down Expand Up @@ -84,39 +83,7 @@ export class CodeWriterDialogComponent {
})
.pipe(
tap((response) => {
this.promptForm.enable();
this.promptForm.controls.prompt.removeValidators(
Validators.required
);
this.promptForm.controls.prompt.setValue('');
try {
const result: {
code: string;
inputs: {
key: string;
value: unknown;
}[];
packages: string[];
} = JSON.parse(response.result);
this.receivedCode$.next(
result.code.replace(/\*\*\*NEW_LINE\*\*\*/g, '\n')
);
this.receivedInputs = result.inputs;
this.receivedPackages = result.packages;
this.receivedPackages.forEach((pkg) => {
this.lookForNpmPackage(pkg);
});
if (this.stepper.selected) {
this.stepper.selected.completed = true;
this.stepper.next();
}
this.prisimFix = !this.prisimFix;
this.highlightPrism();
} catch (e) {
console.error('Copilot response not valid JSON.');
console.error((e as Error).message);
}
this.loading$.next(false);

}),
map(() => void 0)
);
Expand Down Expand Up @@ -149,9 +116,5 @@ export class CodeWriterDialogComponent {
});
this.reset();
}
private highlightPrism() {
setTimeout(() => {
this.highlightService.highlightAll();
}, 10);
}

}

0 comments on commit b5c7b54

Please sign in to comment.