mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix eslint warnigs for core project (#7506)
This commit is contained in:
@@ -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();
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user