mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[MIGRATION] - Fixed lint errors for empty function
This commit is contained in:
@@ -59,7 +59,7 @@ export class DynamicColumnComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
private componentRef: ComponentRef<any>;
|
||||
|
||||
constructor(private extensions: ExtensionService) {}
|
||||
constructor(private extensions: ExtensionService) { /* empty */ }
|
||||
|
||||
ngOnInit() {
|
||||
const componentType = this.extensions.getComponentById(this.id);
|
||||
|
@@ -63,7 +63,7 @@ describe('DynamicExtensionComponent', () => {
|
||||
component.data = { foo: 'bar' };
|
||||
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges({ /* empty */ });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -101,7 +101,7 @@ describe('DynamicExtensionComponent', () => {
|
||||
component.id = 'test-component';
|
||||
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges({ /* empty */ });
|
||||
testComponent = fixture.debugElement.query(By.css('test-component')).componentInstance;
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ describe('DynamicExtensionComponent', () => {
|
||||
});
|
||||
|
||||
it('should call through the ngOnChanges', () => {
|
||||
const params = {};
|
||||
const params = { /* empty */ };
|
||||
|
||||
component.ngOnChanges(params);
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('DynamicExtensionComponent', () => {
|
||||
|
||||
it('should NOT call through the ngOnChanges if the method does not exist (no error should be thrown)', () => {
|
||||
testComponent.ngOnChanges = undefined;
|
||||
const params = {};
|
||||
const params = { /* empty */ };
|
||||
const execution = () => {
|
||||
component.ngOnChanges(params);
|
||||
};
|
||||
|
@@ -38,7 +38,7 @@ export class DynamicExtensionComponent implements OnChanges, OnDestroy {
|
||||
private componentRef: ComponentRef<ExtensionComponent>;
|
||||
private loaded: boolean = false;
|
||||
|
||||
constructor(private extensions: ExtensionService) {}
|
||||
constructor(private extensions: ExtensionService) { /* empty */ }
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (!this.loaded) {
|
||||
|
@@ -37,7 +37,7 @@ export class DynamicTabComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
private componentRef: ComponentRef<any>;
|
||||
|
||||
constructor(private extensions: ExtensionService) {}
|
||||
constructor(private extensions: ExtensionService) { /* empty */ }
|
||||
|
||||
ngOnInit() {
|
||||
const componentType = this.extensions.getComponentById(this.id);
|
||||
|
@@ -41,7 +41,7 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
private componentRef: ComponentRef<any>;
|
||||
|
||||
constructor(private extensionService: ExtensionService) {}
|
||||
constructor(private extensionService: ExtensionService) { /* empty */ }
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.id) {
|
||||
|
@@ -101,7 +101,7 @@ export const reduceEmptyMenus = (
|
||||
};
|
||||
|
||||
export const mergeObjects = (...objects: any[]): any => {
|
||||
const result = {};
|
||||
const result = { /* empty */ };
|
||||
|
||||
objects.forEach((source) => {
|
||||
Object.keys(source).forEach((prop) => {
|
||||
@@ -135,7 +135,7 @@ export const mergeObjects = (...objects: any[]): any => {
|
||||
|
||||
export const mergeArrays = (left: any[], right: any[]): any[] => {
|
||||
const result = [];
|
||||
const map = {};
|
||||
const map = { /* empty */ };
|
||||
|
||||
(left || []).forEach((entry) => {
|
||||
const element = entry;
|
||||
|
@@ -23,11 +23,11 @@ export interface ExtensionComponent {
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ComponentRegisterService {
|
||||
components: { [key: string]: Type<any> } = {};
|
||||
components: { [key: string]: Type<any> } = { /* empty */ };
|
||||
|
||||
setComponents(values: { [key: string]: Type<any> }) {
|
||||
if (values) {
|
||||
this.components = Object.assign({}, this.components, values);
|
||||
this.components = Object.assign({ /* empty */ }, this.components, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -148,7 +148,7 @@ export class ExtensionLoaderService {
|
||||
}
|
||||
|
||||
protected getMetadata(config: ExtensionConfig): ExtensionRef {
|
||||
const result: any = {};
|
||||
const result: any = { /* empty */ };
|
||||
|
||||
Object
|
||||
.keys(config)
|
||||
|
@@ -86,7 +86,7 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should return default value if feature is not found', async () => {
|
||||
const defaultValue = {};
|
||||
const defaultValue = { /* empty */ };
|
||||
service.setup(blankConfig);
|
||||
|
||||
const requestedFeature = service.getFeature<{ test: string }>('searchedFeature', defaultValue);
|
||||
@@ -166,8 +166,8 @@ describe('ExtensionService', () => {
|
||||
let registered = service.getAuthGuards(['guard1']);
|
||||
expect(registered.length).toBe(0);
|
||||
|
||||
const guard1: any = {};
|
||||
const guard2: any = {};
|
||||
const guard1: any = { /* empty */ };
|
||||
const guard2: any = { /* empty */ };
|
||||
|
||||
service.setAuthGuards({
|
||||
auth1: guard1,
|
||||
@@ -181,8 +181,8 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should overwrite authentication guards', () => {
|
||||
const guard1: any = {};
|
||||
const guard2: any = {};
|
||||
const guard1: any = { /* empty */ };
|
||||
const guard2: any = { /* empty */ };
|
||||
|
||||
service.setAuthGuards({
|
||||
auth: guard1
|
||||
@@ -198,7 +198,7 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should not set authentication guards with null value', () => {
|
||||
const guard1: any = {};
|
||||
const guard1: any = { /* empty */ };
|
||||
|
||||
service.setAuthGuards({
|
||||
auth: guard1
|
||||
@@ -215,7 +215,7 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should set components', () => {
|
||||
const component: any = {};
|
||||
const component: any = { /* empty */ };
|
||||
|
||||
service.setComponents({
|
||||
component1: component
|
||||
@@ -225,8 +225,8 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should overwrite components', () => {
|
||||
const component1: any = {};
|
||||
const component2: any = {};
|
||||
const component1: any = { /* empty */ };
|
||||
const component2: any = { /* empty */ };
|
||||
|
||||
service.setComponents({
|
||||
component: component1
|
||||
@@ -242,7 +242,7 @@ describe('ExtensionService', () => {
|
||||
});
|
||||
|
||||
it('should not set components with null value', () => {
|
||||
const component: any = {};
|
||||
const component: any = { /* empty */ };
|
||||
|
||||
service.setComponents({
|
||||
component1: component
|
||||
|
@@ -27,7 +27,7 @@ import { RuleService } from './rule.service';
|
||||
import { ExtensionElement } from '../config/extension-element';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
|
||||
/**
|
||||
* The default extensions factory
|
||||
*
|
||||
@@ -47,7 +47,7 @@ export const EXTENSION_JSON_VALUES = new InjectionToken<string[][]>('extension-j
|
||||
factory: extensionJsonsFactory
|
||||
});
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
|
||||
/**
|
||||
* Provides the extension json values for the angular modules
|
||||
*
|
||||
@@ -86,7 +86,7 @@ export class ExtensionService {
|
||||
routes: Array<RouteRef> = [];
|
||||
actions: Array<ActionRef> = [];
|
||||
features: Array<any> = [];
|
||||
authGuards: { [key: string]: Type<any> } = {};
|
||||
authGuards: { [key: string]: Type<any> } = { /* empty */ };
|
||||
|
||||
setup$: Observable<ExtensionConfig>;
|
||||
|
||||
@@ -179,7 +179,7 @@ export class ExtensionService {
|
||||
*/
|
||||
setAuthGuards(values: { [key: string]: Type<any> }) {
|
||||
if (values) {
|
||||
this.authGuards = Object.assign({}, this.authGuards, values);
|
||||
this.authGuards = Object.assign({ /* empty */ }, this.authGuards, values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ export class ExtensionService {
|
||||
if (typeof value === 'string' ) {
|
||||
return this.evaluateExpression(value, context);
|
||||
} else {
|
||||
const duplicate = Object.assign({}, value);
|
||||
const duplicate = Object.assign({ /* empty */ }, value);
|
||||
Object.keys(duplicate).forEach( (key) => {
|
||||
duplicate[key] = this.evaluateExpression(duplicate[key], context);
|
||||
});
|
||||
|
@@ -26,9 +26,9 @@ import { ExtensionLoaderService } from './extension-loader.service';
|
||||
export class RuleService {
|
||||
context: RuleContext = null;
|
||||
rules: Array<RuleRef> = [];
|
||||
evaluators: { [key: string]: RuleEvaluator } = {};
|
||||
evaluators: { [key: string]: RuleEvaluator } = { /* empty */ };
|
||||
|
||||
constructor(protected loader: ExtensionLoaderService) {}
|
||||
constructor(protected loader: ExtensionLoaderService) { /* empty */ }
|
||||
|
||||
setup(config: ExtensionConfig) {
|
||||
this.rules = this.loader.getRules(config);
|
||||
@@ -41,7 +41,7 @@ export class RuleService {
|
||||
*/
|
||||
setEvaluators(values: { [key: string]: RuleEvaluator }) {
|
||||
if (values) {
|
||||
this.evaluators = Object.assign({}, this.evaluators, values);
|
||||
this.evaluators = Object.assign({ /* empty */ }, this.evaluators, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user