fix eslint warnigs for core project (#7506)

This commit is contained in:
Denys Vuika
2022-02-17 14:35:33 +00:00
committed by GitHub
parent 5b7f255eec
commit bca5a783ab
246 changed files with 5127 additions and 5065 deletions

View File

@@ -55,7 +55,7 @@ describe('LoginDialogPanelComponent', () => {
fixture.destroy();
});
function loginWithCredentials(username: string, password: string) {
const loginWithCredentials = (username: string, password: string) => {
usernameInput.value = username;
passwordInput.value = password;
@@ -65,7 +65,7 @@ describe('LoginDialogPanelComponent', () => {
component.submitForm();
fixture.detectChanges();
}
};
it('should be created', () => {
expect(element.querySelector('#adf-login-form')).not.toBeNull();

View File

@@ -26,7 +26,6 @@ import { LoginErrorEvent } from '../models/login-error.event';
import { LoginSuccessEvent } from '../models/login-success.event';
import { LoginComponent } from './login.component';
import { of, throwError } from 'rxjs';
import { OauthConfigModel } from '../../models/oauth-config.model';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { setupTestBed } from '../../testing/setup-test-bed';
@@ -46,9 +45,7 @@ describe('LoginComponent', () => {
let usernameInput;
let passwordInput;
const getLoginErrorElement = () => {
return element.querySelector('#login-error');
};
const getLoginErrorElement = () => element.querySelector('#login-error');
const getLoginErrorMessage = () => {
const errorMessage = undefined;
@@ -94,7 +91,7 @@ describe('LoginComponent', () => {
fixture.destroy();
});
function loginWithCredentials(username: string, password: string) {
const loginWithCredentials = (username: string, password: string) => {
usernameInput.value = username;
passwordInput.value = password;
@@ -104,7 +101,7 @@ describe('LoginComponent', () => {
element.querySelector('.adf-login-button').click();
fixture.detectChanges();
}
};
it('should be autocomplete off', () => {
expect(
@@ -616,7 +613,7 @@ describe('LoginComponent', () => {
describe('implicitFlow ', () => {
beforeEach(() => {
appConfigService.config.oauth2 = <OauthConfigModel> { implicitFlow: true, silentLogin: false };
appConfigService.config.oauth2 = { implicitFlow: true, silentLogin: false };
appConfigService.load();
alfrescoApiService.reset();
});
@@ -634,7 +631,7 @@ describe('LoginComponent', () => {
it('should not render the implicitFlow button in case silentLogin is enabled', fakeAsync(() => {
spyOn(authService, 'isOauth').and.returnValue(true);
appConfigService.config.oauth2 = <OauthConfigModel> { implicitFlow: true, silentLogin: true };
appConfigService.config.oauth2 = { implicitFlow: true, silentLogin: true };
spyOn(component, 'redirectToImplicitLogin').and.stub();

View File

@@ -39,6 +39,7 @@ import { DomSanitizer, SafeStyle } from '@angular/platform-browser';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
// eslint-disable-next-line no-shadow
enum LoginSteps {
Landing = 0,
Checking = 1,
@@ -195,6 +196,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/**
* Method called on submit form
*
* @param values
* @param event
*/
@@ -220,6 +222,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/**
* The method check the error in the form and push the error in the formError object
*
* @param data
*/
onValueChanged(data: any) {
@@ -306,6 +309,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/**
* Add a custom form error for a field
*
* @param field
* @param msg
*/
@@ -315,6 +319,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/**
* Add a custom validation rule error for a field
*
* @param field
* @param ruleId - i.e. required | minlength | maxlength
* @param msg
@@ -341,6 +346,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/**
* The method return if a field is valid or not
*
* @param field
*/
isErrorStyle(field: AbstractControl) {