mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-01-17 04:11:09 +00:00
fixing linting errors.
This commit is contained in:
parent
6653ea5a8f
commit
0ee43cca21
@ -1,6 +1,5 @@
|
||||
import { formatDate } from '@angular/common';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { stringify } from '@angular/compiler/src/util';
|
||||
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, NgZone, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { ControlValueAccessor } from '@angular/forms';
|
||||
import BpmnModeler from 'bpmn-js/lib/Modeler';
|
||||
@ -67,7 +66,6 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit, On
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
// ? I feel like there's better ways to handle the changes to a single attribute but I didn't want to mess around with getters and setters since this class already had some
|
||||
if (changes.validation_data) {
|
||||
this.validation_data = changes.validation_data.currentValue;
|
||||
if (this.modeler) {
|
||||
@ -219,13 +217,13 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit, On
|
||||
});
|
||||
}
|
||||
});
|
||||
var eventBus = this.modeler.get('eventBus');
|
||||
const eventBus = this.modeler.get('eventBus');
|
||||
|
||||
eventBus.on('editor.scripts.request', () => {
|
||||
this.api.listScripts().subscribe((data) => {
|
||||
data.forEach(element => {element.name = CameltoSnakeCase(element.name);});
|
||||
data.forEach(element => {element.name = CameltoSnakeCase(element.name); });
|
||||
this.modeler.get('eventBus').fire('editor.scripts.response', { scripts: data });
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
eventBus.on('editor.validate.request', (request) => {
|
||||
|
@ -201,17 +201,17 @@ export class ModelerComponent implements AfterViewInit {
|
||||
this.saveChanges();
|
||||
this.api.validateWorkflowSpecification(this.diagramFileMeta.workflow_spec_id, until_task).subscribe(apiErrors => {
|
||||
this.validationState = true;
|
||||
this.validationData = { "required_only": undefined, "all_fields": undefined }
|
||||
if (apiErrors && apiErrors.length == 2) {
|
||||
if (apiErrors[0].code == "validation_break") {
|
||||
this.validationData["all_fields"] = apiErrors[0].task_data;
|
||||
this.validationData = { 'required_only': undefined, 'all_fields': undefined };
|
||||
if (apiErrors && apiErrors.length === 2) {
|
||||
if (apiErrors[0].code === 'validation_break') {
|
||||
this.validationData['all_fields'] = apiErrors[0].task_data;
|
||||
} else { this.validationState = false; }
|
||||
if (apiErrors[1].code == "validation_break") {
|
||||
this.validationData["required_only"] = apiErrors[1].task_data;
|
||||
if (apiErrors[1].code === 'validation_break') {
|
||||
this.validationData['required_only'] = apiErrors[1].task_data;
|
||||
} else { this.validationState = false; }
|
||||
} else { this.validationState = false; }
|
||||
|
||||
if (this.validationState == false) {
|
||||
if (this.validationState === false) {
|
||||
this.bottomSheet.open(ApiErrorsComponent, { data: { apiErrors: apiErrors } });
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user