Fixes remaining linting errors

This commit is contained in:
Aaron Louie 2021-08-12 11:07:52 -04:00
parent 41f7ce4d0e
commit 1b447a9d88
4 changed files with 7 additions and 7 deletions

View File

@ -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\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i;
return re.test(this.url);
}

View File

@ -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;

View File

@ -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;
}
}
};

View File

@ -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<string> = new EventEmitter();
public eventBus;
@Output() private importDone: EventEmitter<ImportEvent> = new EventEmitter();
public eventBus;
private diagramType: FileType;
private modeler: BpmnModeler | DmnModeler;
private xml = '';