diff --git a/src/app/_dialogs/open-file-dialog/open-file-dialog.component.ts b/src/app/_dialogs/open-file-dialog/open-file-dialog.component.ts index 56c74c2..ac5fc2a 100644 --- a/src/app/_dialogs/open-file-dialog/open-file-dialog.component.ts +++ b/src/app/_dialogs/open-file-dialog/open-file-dialog.component.ts @@ -57,7 +57,7 @@ export class OpenFileDialogComponent { } isValidUrl() { - // tslint:disable-next-line:max-line-length + // eslint-disable-next-line max-len const re = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.​\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[​6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1​,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00​a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u​00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i; return re.test(this.url); } diff --git a/src/app/_forms/validators/email.regex.ts b/src/app/_forms/validators/email.regex.ts index b93a261..cb8fd3c 100644 --- a/src/app/_forms/validators/email.regex.ts +++ b/src/app/_forms/validators/email.regex.ts @@ -1,4 +1,4 @@ -// tslint:disable-next-line:max-line-length +// eslint-disable-next-line max-len export const EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i; export default EMAIL_REGEX; diff --git a/src/app/_forms/validators/email.validator.ts b/src/app/_forms/validators/email.validator.ts index 247255d..c9fc601 100644 --- a/src/app/_forms/validators/email.validator.ts +++ b/src/app/_forms/validators/email.validator.ts @@ -1,9 +1,9 @@ import { AbstractControl, ValidationErrors } from '@angular/forms'; import EMAIL_REGEX from './email.regex'; -export function ValidateEmail(control: AbstractControl): ValidationErrors { +export const ValidateEmail = (control: AbstractControl): ValidationErrors => { if (!EMAIL_REGEX.test(control.value) && control.value && control.value !== '') { const error: ValidationErrors = { email: true }; return error; } -} +}; diff --git a/src/app/diagram/diagram.component.ts b/src/app/diagram/diagram.component.ts index 55d8994..1bcbdda 100644 --- a/src/app/diagram/diagram.component.ts +++ b/src/app/diagram/diagram.component.ts @@ -36,14 +36,14 @@ import { getDiagramTypeFromXml } from '../_util/diagram-type'; styleUrls: ['diagram.component.scss'], }) export class DiagramComponent implements ControlValueAccessor, AfterViewInit, OnChanges { + @ViewChild('containerRef', {static: true}) containerRef: ElementRef; + @ViewChild('propertiesRef', {static: true}) propertiesRef: ElementRef; @Input() fileName: string; @Input() validation_data: { [key: string]: any } = {}; @Input() validation_state: string; - @ViewChild('containerRef', {static: true}) containerRef: ElementRef; - @ViewChild('propertiesRef', {static: true}) propertiesRef: ElementRef; @Output() validationStart: EventEmitter = new EventEmitter(); - public eventBus; @Output() private importDone: EventEmitter = new EventEmitter(); + public eventBus; private diagramType: FileType; private modeler: BpmnModeler | DmnModeler; private xml = '';