[AAE-7100] ESLint support for ADF Core and DemoShell projects (#7481)

* remove tsconfig.base as per eslint schematics

* add schematics

* upgrade demoshell to eslint

* fix eslint issues for demoshell

* integrate eslint for ADF core and fix some issues

* turn into warn

* fix code

* workaround for Chrome clipboard issue

* exclude e2e tests

* exclude e2e
This commit is contained in:
Denys Vuika 2022-02-02 18:01:47 +00:00 committed by GitHub
parent 6ef4838688
commit b8bb234410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
192 changed files with 2553 additions and 483 deletions

105
.eslintrc.json Normal file
View File

@ -0,0 +1,105 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"plugins": [
"eslint-plugin-unicorn",
"eslint-plugin-rxjs"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": [
"element",
"attribute"
],
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/no-host-metadata-property": "off",
"@angular-eslint/no-input-prefix": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/member-ordering": "warn",
"prefer-arrow/prefer-arrow-functions": "warn",
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": "error",
"default-case": "error",
"import/order": "off",
"max-len": [
"error",
{
"code": 240
}
],
"no-bitwise": "off",
"no-duplicate-imports": "error",
"no-multiple-empty-lines": "error",
"no-redeclare": "error",
"no-return-await": "error",
"rxjs/no-create": "error",
"rxjs/no-subject-unsubscribe": "error",
"rxjs/no-subject-value": "error",
"rxjs/no-unsafe-takeuntil": "error",
"unicorn/filename-case": "error"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}

View File

@ -1,5 +1,5 @@
{
"extends": "../tsconfig.base.json",
"extends": "../tsconfig.json",
"exclude": [
"../**/*.spec.js",
"../**/*.spec.ts",

View File

@ -124,47 +124,47 @@
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-blue-orange.scss",
"bundleName" : "adf-blue-orange"
"bundleName": "adf-blue-orange"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-blue-purple.scss",
"bundleName" : "adf-blue-purple"
"bundleName": "adf-blue-purple"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-cyan-orange.scss",
"bundleName" : "adf-cyan-orange"
"bundleName": "adf-cyan-orange"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-cyan-purple.scss",
"bundleName" : "adf-cyan-purple"
"bundleName": "adf-cyan-purple"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-green-orange.scss",
"bundleName" : "adf-green-orange"
"bundleName": "adf-green-orange"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-green-purple.scss",
"bundleName" : "adf-green-purple"
"bundleName": "adf-green-purple"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-indigo-pink.scss",
"bundleName" : "adf-indigo-pink"
"bundleName": "adf-indigo-pink"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-pink-bluegrey.scss",
"bundleName" : "adf-pink-bluegrey"
"bundleName": "adf-pink-bluegrey"
},
{
"inject": false,
"input": "lib/core/styles/prebuilt/adf-purple-green.scss",
"bundleName" : "adf-purple-green"
"bundleName": "adf-purple-green"
},
"demo-shell/src/assets/fonts/material-icons/material-icons.css",
"demo-shell/src/assets/fonts/muli/muli.css",
@ -355,15 +355,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.dev.json"
],
"exclude": [
"**/node_modules/**/*",
"**/lib/**/*",
"package.json"
"lintFilePatterns": [
"demo-shell/**/*.ts",
"demo-shell/**/*.html"
]
}
}
@ -438,19 +434,11 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"lib/core/tsconfig.lib.json",
"lib/core/tsconfig.spec.json"
],
"exclude": [
"**/lib/extensions/**/*",
"**/lib/content-services/**/*",
"**/lib/insights/**/*",
"**/lib/process-services-cloud/**/*",
"**/lib/process-services/**/*",
"**/node_modules/**"
"lintFilePatterns": [
"lib/core/**/*.ts",
"lib/core/**/*.html"
]
}
},

94
demo-shell/.eslintrc.json Normal file
View File

@ -0,0 +1,94 @@
{
"extends": "../.eslintrc.json",
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"demo-shell/tsconfig.app.json",
"demo-shell/src/tsconfig.spec.json",
"demo-shell/e2e/tsconfig.e2e.json"
],
"createDefaultProgram": true
},
"plugins": [
"eslint-plugin-unicorn",
"eslint-plugin-rxjs"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": [
"element",
"attribute"
],
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/no-host-metadata-property": "off",
"@angular-eslint/no-input-prefix": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "error",
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": "error",
"default-case": "error",
"import/order": "off",
"max-len": [
"error",
{
"code": 240
}
],
"no-bitwise": "off",
"no-duplicate-imports": "error",
"no-multiple-empty-lines": "error",
"no-redeclare": "error",
"no-return-await": "error",
"rxjs/no-create": "error",
"rxjs/no-subject-unsubscribe": "error",
"rxjs/no-subject-value": "error",
"rxjs/no-unsafe-takeuntil": "error",
"unicorn/filename-case": "error"
}
},
{
"files": [
"*.html"
],
"rules": {}
}
]
}

View File

@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",

View File

@ -25,7 +25,7 @@ import { ThemePalette } from '@angular/material/core';
@Component({
templateUrl: './app-layout.component.html',
styleUrls: ['./app-layout.component.scss'],
host: { 'class': 'app-layout' },
host: { class: 'app-layout' },
encapsulation: ViewEncapsulation.None
})
export class AppLayoutComponent implements OnInit, OnDestroy {

View File

@ -72,7 +72,7 @@ export class FormCloudDemoComponent implements OnInit, OnDestroy {
'custom-something': () => CustomWidgetComponent,
'custom-boolean': () => CustomWidgetComponent,
'custom-date': () => CustomWidgetComponent,
'custom': () => CustomWidgetComponent
custom: () => CustomWidgetComponent
});
}
@ -122,7 +122,7 @@ export class FormCloudDemoComponent implements OnInit, OnDestroy {
const fileReader = new FileReader();
fileReader.onload = () => {
this.formConfig = <string> fileReader.result;
this.formConfig = fileReader.result as string;
};
fileReader.readAsText(file);

View File

@ -231,6 +231,7 @@ export class CardViewComponent implements OnInit, OnDestroy {
value: of([
{ icon: 'directions_bike', value: 'Zlatan' },
{ icon: 'directions_bike', value: 'Lionel Messi' },
// eslint-disable-next-line @typescript-eslint/naming-convention
{ value: 'Mohamed', directions_bike: 'save' },
{ value: 'Ronaldo' }
]),

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ViewEncapsulation } from '@angular/core';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { CloudLayoutService } from '../services/cloud-layout.service';
@ -31,7 +31,7 @@ import { CloudLayoutService } from '../services/cloud-layout.service';
`],
encapsulation: ViewEncapsulation.None
})
export class CommunityCloudComponent {
export class CommunityCloudComponent implements OnInit {
constructor(
private router: Router,

View File

@ -31,13 +31,13 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Pagination } from '@alfresco/js-api';
const PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter';
const ACTION_SAVE_AS = 'saveAs';
@Component({
templateUrl: './community-processes-cloud.component.html'
})
export class CommunityProcessesCloudDemoComponent implements OnInit, OnDestroy {
public static ACTION_SAVE_AS = 'saveAs';
static PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter';
@ViewChild('processCloud')
processCloud: ProcessListCloudComponent;
@ -66,7 +66,7 @@ export class CommunityProcessesCloudDemoComponent implements OnInit, OnDestroy {
private processFilterCloudService: ProcessFilterCloudService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(
CommunityProcessesCloudDemoComponent.PROCESS_FILTER_PROPERTY_KEYS
PROCESS_FILTER_PROPERTY_KEYS
);
if (properties) {
@ -138,7 +138,7 @@ export class CommunityProcessesCloudDemoComponent implements OnInit, OnDestroy {
onProcessFilterAction(filterAction: any) {
this.cloudLayoutService.setCurrentProcessFilterParam({ id: filterAction.filter.id });
if (filterAction.actionType === CommunityProcessesCloudDemoComponent.ACTION_SAVE_AS) {
if (filterAction.actionType === ACTION_SAVE_AS) {
this.router.navigate([`/cloud/community/processes/`], { queryParams: filterAction.filter });
}
}

View File

@ -24,17 +24,14 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Pagination } from '@alfresco/js-api';
const ACTION_SAVE_AS = 'saveAs';
const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@Component({
templateUrl: './community-task-cloud.component.html',
styles: [`.adf-cloud-layout-tab-body .mat-tab-body-wrapper {
height: 100%;
}
`]
styles: [`.adf-cloud-layout-tab-body .mat-tab-body-wrapper { height: 100%; }`]
})
export class CommunityTasksCloudDemoComponent implements OnInit, OnDestroy {
public static ACTION_SAVE_AS = 'saveAs';
static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@ViewChild('taskCloud')
taskCloud: TaskListCloudComponent;
@ -63,7 +60,7 @@ export class CommunityTasksCloudDemoComponent implements OnInit, OnDestroy {
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(CommunityTasksCloudDemoComponent.TASK_FILTER_PROPERTY_KEYS);
const properties = this.appConfig.get<Array<any>>(TASK_FILTER_PROPERTY_KEYS);
if (properties) {
this.taskFilterProperties = properties;
}
@ -137,7 +134,7 @@ export class CommunityTasksCloudDemoComponent implements OnInit, OnDestroy {
onTaskFilterAction(filterAction: any) {
this.cloudLayoutService.setCurrentTaskFilterParam({ id: filterAction.filter.id });
if (filterAction.actionType === CommunityTasksCloudDemoComponent.ACTION_SAVE_AS) {
if (filterAction.actionType === ACTION_SAVE_AS) {
this.router.navigate([`/cloud/community/tasks/`], { queryParams: filterAction.filter });
}
}

View File

@ -17,7 +17,7 @@
import { Component, OnInit } from '@angular/core';
import { FormService, WidgetComponent } from '@alfresco/adf-core';
// tslint:disable:component-selector
/* eslint-disable @angular-eslint/component-selector */
@Component({
selector: 'custom-editor-widget',

View File

@ -27,7 +27,7 @@
<input matInput (input)="setPeopleAppName($any($event).target?.value)" data-automation-id="app-people-app-input" />
</mat-form-field>
<mat-form-field class="app-preselect-value-full">
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.PRESELECTED_VALUE' | translate }} {{ DEFAULT_PEOPLE_PLACEHOLDER }}</mat-label>
<mat-label>{{ 'PEOPLE_GROUPS_CLOUD.PRESELECTED_VALUE' | translate }} {{ defaultPeoplePlaceholder }}</mat-label>
<input matInput (input)="setPeoplePreselectValue($any($event).target?.value)" data-automation-id="app-people-preselect-input" />
</mat-form-field>
<mat-checkbox class="app-preselect-value" (change)="onChangePeopleValidation($event)">{{
@ -102,7 +102,7 @@
data-automation-id="app-group-app-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value-full">
<mat-label>Preselect: {{ DEFAULT_GROUP_PLACEHOLDER }}</mat-label>
<mat-label>Preselect: {{ defaultGroupPlaceholder }}</mat-label>
<input matInput
(input)="setGroupsPreselectValue($any($event).target?.value)"
data-automation-id="app-group-preselect-input" />

View File

@ -29,16 +29,16 @@ import { IdentityGroupModel, IdentityUserModel } from '@alfresco/adf-core';
})
export class PeopleGroupCloudDemoComponent {
DEFAULT_FILTER_MODE: string = 'appName';
DEFAULT_GROUP_PLACEHOLDER: string = `[{"id": "1", "name":"activitiUserGroup"}]`;
DEFAULT_PEOPLE_PLACEHOLDER: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`;
defaultFilterMode: string = 'appName';
defaultGroupPlaceholder: string = `[{"id": "1", "name":"activitiUserGroup"}]`;
defaultPeoplePlaceholder: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`;
peopleMode: ComponentSelectionMode = 'single';
preSelectUsers: IdentityUserModel[] = [];
invalidUsers: IdentityUserModel[] = [];
peopleRoles: string[] = [];
peopleAppName: string;
peopleFilterMode: string = this.DEFAULT_FILTER_MODE;
peopleFilterMode: string = this.defaultFilterMode;
peoplePreselectValidation = false;
groupPreselectValidation = false;
peopleReadonly = false;
@ -49,7 +49,7 @@ export class PeopleGroupCloudDemoComponent {
invalidGroups: IdentityGroupModel[] = [];
groupRoles: string[];
groupAppName: string;
groupFilterMode: string = this.DEFAULT_FILTER_MODE;
groupFilterMode: string = this.defaultFilterMode;
setPeoplePreselectValue(value: string): void {
this.preSelectUsers = this.getArrayFromString(value);

View File

@ -39,7 +39,7 @@ export class ProcessCloudLayoutComponent {
'custom-something': () => CustomWidgetComponent,
'custom-boolean': () => CustomWidgetComponent,
'custom-date': () => CustomWidgetComponent,
'custom': () => CustomWidgetComponent
custom: () => CustomWidgetComponent
});
}
}

View File

@ -41,8 +41,8 @@ export class ProcessesCloudDemoComponent implements OnInit, OnDestroy {
actionMenu: boolean;
contextMenu: boolean;
actions: any[] = [];
selectedAction: { id: number, name: string, actionType: string};
selectedContextAction: { id: number, name: string, actionType: string};
selectedAction: { id: number; name: string; actionType: string};
selectedContextAction: { id: number; name: string; actionType: string};
filterProperties: string[];
filterSortProperties: string[];
@ -145,14 +145,12 @@ export class ProcessesCloudDemoComponent implements OnInit, OnDestroy {
}
onShowRowContextMenu(event: DataCellEvent) {
event.value.actions = this.actions.map((action) => {
return {
event.value.actions = this.actions.map((action) => ({
data: event.value.row['obj'],
model: action,
subject: this.performAction$
};
});
}));
}
onExecuteRowAction(row: any) {

View File

@ -22,15 +22,12 @@ import { CloudLayoutService, CloudServiceSettings } from './services/cloud-layou
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-service-task-filter';
@Component({
templateUrl: './service-task-list-cloud-demo.component.html'
})
export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
public static ACTION_SAVE_AS = 'saveAs';
public static ACTION_DELETE = 'delete';
static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-service-task-filter';
@ViewChild('taskCloud')
taskCloud: ServiceTaskListCloudComponent;
@ -49,8 +46,8 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
actionMenu: boolean;
contextMenu: boolean;
actions: any[] = [];
selectedAction: { id: number, name: string, actionType: string};
selectedContextAction: { id: number, name: string, actionType: string};
selectedAction: { id: number; name: string; actionType: string};
selectedContextAction: { id: number; name: string; actionType: string};
selectionMode: string;
filterId: string;
@ -61,7 +58,7 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(ServiceTaskListCloudDemoComponent.TASK_FILTER_PROPERTY_KEYS);
const properties = this.appConfig.get<Array<any>>(TASK_FILTER_PROPERTY_KEYS);
if (properties === this.taskFilterProperties) {
this.taskFilterProperties = properties;
}

View File

@ -45,11 +45,11 @@ export class CloudProcessFiltersService {
);
}
readQueryParams(obj: Object): ProcessFilterCloudModel {
readQueryParams(obj: any): ProcessFilterCloudModel {
return this.processFilterCloudService.readQueryParams(obj);
}
writeQueryParams(value: Object, appName?: string, id?: string): Object {
writeQueryParams(value: any, appName?: string, id?: string): any {
return this.processFilterCloudService.writeQueryParams(value, this.filterProperties, appName, id);
}
}

View File

@ -114,7 +114,7 @@ export class CloudSettingsComponent implements OnInit, OnDestroy {
}
addAction() {
this.actions.push(<ActionMenuModel> this.actionMenuForm.value);
this.actions.push(this.actionMenuForm.value);
this.actionMenuForm.get('key').reset();
this.actionMenuForm.get('title').reset();
this.actionMenuForm.get('icon').reset();

View File

@ -23,15 +23,14 @@ import { CloudLayoutService } from './services/cloud-layout.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
const ACTION_SAVE_AS = 'saveAs';
const ACTION_DELETE = 'delete';
const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@Component({
templateUrl: './tasks-cloud-demo.component.html'
})
export class TasksCloudDemoComponent implements OnInit, OnDestroy {
public static ACTION_SAVE_AS = 'saveAs';
public static ACTION_DELETE = 'delete';
static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@ViewChild('taskCloud')
taskCloud: TaskListCloudComponent;
@ -51,8 +50,8 @@ export class TasksCloudDemoComponent implements OnInit, OnDestroy {
actionMenu: boolean;
contextMenu: boolean;
actions: any[] = [];
selectedAction: { id: number, name: string, actionType: string};
selectedContextAction: { id: number, name: string, actionType: string};
selectedAction: { id: number; name: string; actionType: string};
selectedContextAction: { id: number; name: string; actionType: string};
testingMode: boolean;
selectionMode: string;
taskDetailsRedirection: boolean;
@ -67,7 +66,7 @@ export class TasksCloudDemoComponent implements OnInit, OnDestroy {
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(TasksCloudDemoComponent.TASK_FILTER_PROPERTY_KEYS);
const properties = this.appConfig.get<Array<any>>(TASK_FILTER_PROPERTY_KEYS);
if (properties) {
this.taskFilterProperties = properties;
}
@ -134,13 +133,13 @@ export class TasksCloudDemoComponent implements OnInit, OnDestroy {
onTaskFilterAction(filterAction: any) {
if (filterAction.actionType === TasksCloudDemoComponent.ACTION_DELETE) {
if (filterAction.actionType === ACTION_DELETE) {
this.cloudLayoutService.setCurrentTaskFilterParam({ index: 0 });
} else {
this.cloudLayoutService.setCurrentTaskFilterParam({ id: filterAction.filter.id });
}
if (filterAction.actionType === TasksCloudDemoComponent.ACTION_SAVE_AS) {
if (filterAction.actionType === ACTION_SAVE_AS) {
this.router.navigate([`/cloud/${this.appName}/tasks/`], { queryParams: filterAction.filter });
}
}
@ -150,14 +149,12 @@ export class TasksCloudDemoComponent implements OnInit, OnDestroy {
}
onShowRowContextMenu(event: DataCellEvent) {
event.value.actions = this.actions.map((action) => {
return {
event.value.actions = this.actions.map((action) => ({
data: event.value.row['obj'],
model: action,
subject: this.performAction$
};
});
}));
}
onExecuteRowAction(row: any) {

View File

@ -53,7 +53,7 @@ export class ConfirmDialogExampleComponent {
const dialog = this.dialog.open(ConfirmDialogComponent, {
data: {
title: 'Upload',
thirdOptionLabel: thirdOptionLabel,
thirdOptionLabel,
message: `This is the default message`
},
minWidth: '250px'

View File

@ -73,8 +73,8 @@ export class DataTableComponent {
{ value: 'multiple', viewValue: 'Multiple' }
];
private _imageUrl = 'http://placehold.it/140x100';
private _createdBy: any = {
private imageUrl = 'http://placehold.it/140x100';
private createdBy: any = {
name: 'Administrator',
email: 'admin@alfresco.com'
};
@ -91,7 +91,7 @@ export class DataTableComponent {
if (col.key === 'status') {
const users = row.getValue('users');
return (value || []).map((status, index) => ({ 'name': `${users[index].firstName} ${users[index].lastName}`, status }));
return (value || []).map((status, index) => ({ name: `${users[index].firstName} ${users[index].lastName}`, status }));
}
return value;
@ -110,7 +110,7 @@ export class DataTableComponent {
Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.`,
createdOn: new Date(2016, 6, 2, 15, 8, 1),
createdBy: this._createdBy,
createdBy: this.createdBy,
icon: 'material-icons://folder_open',
json: null,
users: [
@ -132,7 +132,7 @@ export class DataTableComponent {
id: 2,
name: 'Name 2',
createdOn: new Date(2016, 6, 2, 15, 8, 2),
createdBy: this._createdBy,
createdBy: this.createdBy,
icon: 'material-icons://accessibility',
json: null,
users: [
@ -154,7 +154,7 @@ export class DataTableComponent {
id: 3,
name: 'Name 3',
createdOn: new Date(2016, 6, 2, 15, 8, 3),
createdBy: this._createdBy,
createdBy: this.createdBy,
icon: 'material-icons://alarm',
json: null,
users: [
@ -176,7 +176,7 @@ export class DataTableComponent {
id: 4,
name: 'Image 8',
createdOn: new Date(2016, 6, 2, 15, 8, 4),
createdBy: this._createdBy,
createdBy: this.createdBy,
icon: 'material-icons://alarm',
json: {
id: 4,
@ -207,7 +207,7 @@ export class DataTableComponent {
id: 5,
name: 'I am using custom resolver',
createdOn: new Date(2016, 6, 2, 15, 8, 4),
createdBy: this._createdBy,
createdBy: this.createdBy,
icon: 'material-icons://person_outline',
users: [
{
@ -244,11 +244,11 @@ export class DataTableComponent {
addRow() {
const id = this.data.getRows().length + 1;
const row = new ObjectDataRow({
id: id,
id,
name: 'Name ' + id,
createdOn: new Date(),
icon: 'material-icons://extension',
createdBy: this._createdBy
createdBy: this.createdBy
});
this.data.getRows().push(row);
this.data.sort();
@ -259,30 +259,30 @@ export class DataTableComponent {
{
id: 10,
name: 'Name 10',
createdBy: this._createdBy,
createdBy: this.createdBy,
createdOn: new Date(2016, 6, 2, 15, 8, 5),
icon: 'material-icons://face'
},
{
id: 11,
name: 'Name 11',
createdBy: this._createdBy,
createdBy: this.createdBy,
createdOn: new Date(2016, 6, 2, 15, 8, 6),
icon: 'material-icons://language'
},
{
id: 12,
name: 'Name 12',
createdBy: this._createdBy,
createdBy: this.createdBy,
createdOn: new Date(2016, 6, 2, 15, 8, 7),
icon: 'material-icons://pets'
},
{
id: 13,
name: 'Image 13',
createdBy: this._createdBy,
createdBy: this.createdBy,
createdOn: new Date(2016, 6, 2, 15, 8, 8),
icon: this._imageUrl
icon: this.imageUrl
}
];
const rows = objects.map((obj) => new ObjectDataRow(obj));

View File

@ -262,10 +262,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit() {
if (!this.pagination) {
this.pagination = <Pagination> {
this.pagination = {
maxItems: this.preference.paginationSize,
skipCount: 0
};
} as Pagination;
}
if (this.route) {
@ -345,7 +345,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
ngOnChanges(changes: SimpleChanges) {
if (changes.nodeResult && changes.nodeResult.currentValue) {
this.nodeResult = <NodePaging> changes.nodeResult.currentValue;
this.nodeResult = changes.nodeResult.currentValue;
this.pagination = this.nodeResult.list.pagination;
}
if (!this.pagination) {
@ -354,12 +354,12 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
giveDefaultPaginationWhenNotDefined() {
this.pagination = <Pagination> {
this.pagination = {
maxItems: this.preference.paginationSize,
skipCount: 0,
totalItems: 0,
hasMoreItems: false
};
} as Pagination;
}
getCurrentDocumentListNode(): MinimalNodeEntity[] {
@ -650,8 +650,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
if (this.contentService.hasAllowableOperations(contentEntry, 'update')) {
this.dialog.open(VersionManagerDialogAdapterComponent, {
data: {
contentEntry: contentEntry, showComments: showComments, allowDownload: allowDownload,
newFileVersion: newFileVersion, showComparison: true
contentEntry,
showComments,
allowDownload,
newFileVersion,
showComparison: true
},
panelClass: 'adf-version-manager-dialog',
width: '630px'

View File

@ -106,7 +106,7 @@ export class FormComponent implements OnInit, OnDestroy {
const fileReader = new FileReader();
fileReader.onload = () => {
this.formConfig = <string> fileReader.result;
this.formConfig = fileReader.result as string;
};
fileReader.readAsText(file);

View File

@ -21,7 +21,7 @@ import { ThemePalette } from '@angular/material/core';
@Injectable({
providedIn: 'root'
})
// tslint:disable-next-line: directive-class-suffix
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export class HeaderDataService {
show = true;

View File

@ -72,7 +72,7 @@
</mat-expansion-panel-header>
<mat-form-field class="app-input-field">
<input matInput placeholder="Number" [(ngModel)]="number">
<input matInput placeholder="Number" [(ngModel)]="numberValue">
</mat-form-field>
<mat-form-field class="app-input-field">
<input matInput placeholder="Min Integer Digits" [(ngModel)]="decimalValues.minIntegerDigits">
@ -93,16 +93,16 @@
</mat-form-field>
<h3>AdfDecimalNumber Pipe - Default</h3>
<div>{{ number | adfDecimalNumber }} </div>
<div>{{ numberValue | adfDecimalNumber }} </div>
<br>
<h3>AdfDecimalNumber Pipe - Custom digits config</h3>
<div>{{ number | adfDecimalNumber : decimalValues }} </div>
<div>{{ numberValue | adfDecimalNumber : decimalValues }} </div>
<br>
<h3>AdfDecimalNumber Pipe - Custom locale</h3>
<div>{{ number | adfDecimalNumber : null : locale }} </div>
<div>{{ numberValue | adfDecimalNumber : null : locale }} </div>
<br>
<h3>AdfDecimalNumber Pipe - Custom digits config and locale</h3>
<div>{{ number | adfDecimalNumber : decimalValues : locale }} </div>
<div>{{ numberValue | adfDecimalNumber : decimalValues : locale }} </div>
<br>
</mat-expansion-panel>

View File

@ -28,7 +28,7 @@ export class PipesComponent {
today = new Date();
locale: string;
format: string;
number = 12345.56;
numberValue = 12345.56;
decimalValues = {
minIntegerDigits: undefined,
minFractionDigits: undefined,

View File

@ -21,25 +21,22 @@ import { ActivatedRoute, Params } from '@angular/router';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
const DEFAULT_SIZE = 20;
@Component({
templateUrl: './process-list-demo.component.html',
styleUrls: [`./process-list-demo.component.scss`]
})
export class ProcessListDemoComponent implements OnInit, OnDestroy {
DEFAULT_SIZE = 20;
minValue = 0;
processListForm: FormGroup;
appId: number;
processDefId: string;
processInsId: string;
state: string;
sort: string;
size: number = this.DEFAULT_SIZE;
size: number = DEFAULT_SIZE;
page: number = 0;
presetColumn = 'default';
@ -140,7 +137,7 @@ export class ProcessListDemoComponent implements OnInit, OnDestroy {
this.processDefId = null;
this.state = this.stateOptions[0].value;
this.sort = null;
this.size = this.DEFAULT_SIZE;
this.size = DEFAULT_SIZE;
this.page = null;
}

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable */
/* eslint-disable */
import { Component, NgModule } from '@angular/core';
import { WidgetComponent } from '@alfresco/adf-core';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
// tslint:disable-next-line:adf-file-name
// eslint-disable-next-line
import {
AfterViewInit,
Component,

View File

@ -30,10 +30,10 @@ export class TestSearchConfigurationService implements SearchConfigurationInterf
include: ['path', 'allowableOperations'],
paging: {
maxItems: maxResults,
skipCount: skipCount
skipCount
},
filterQueries: [
/*tslint:disable-next-line */
/* eslint-disable-next-line */
{ query: "TYPE:'cm:folder'" },
{ query: 'NOT cm:creator:System' }]
};

View File

@ -23,7 +23,7 @@ import { ActivatedRoute, Router } from '@angular/router';
templateUrl: './shared-link-view.component.html',
styleUrls: [ './shared-link-view.component.scss' ],
encapsulation: ViewEncapsulation.None,
// tslint:disable-next-line:use-host-property-decorator
// eslint-disable-next-line
host: { 'class': 'app-shared-link-view' }
})
export class SharedLinkViewComponent implements OnInit {

View File

@ -22,6 +22,8 @@ import { debounceTime, takeUntil } from 'rxjs/operators';
import moment from 'moment-es6';
import { Subject } from 'rxjs';
const DEFAULT_SIZE = 20;
@Component({
selector: 'app-task-list-demo',
templateUrl: './task-list-demo.component.html',
@ -29,8 +31,6 @@ import { Subject } from 'rxjs';
})
export class TaskListDemoComponent implements OnInit, OnDestroy {
DEFAULT_SIZE = 20;
taskListForm: FormGroup;
errorMessage: string;
@ -46,7 +46,7 @@ export class TaskListDemoComponent implements OnInit, OnDestroy {
name: string;
sort: string;
start: number;
size: number = this.DEFAULT_SIZE;
size: number = DEFAULT_SIZE;
page: number = 0;
dueAfter: string;
dueBefore: string;
@ -184,7 +184,7 @@ export class TaskListDemoComponent implements OnInit, OnDestroy {
this.state = null;
this.sort = null;
this.start = null;
this.size = this.DEFAULT_SIZE;
this.size = DEFAULT_SIZE;
this.page = null;
this.dueAfter = null;
this.dueBefore = null;

View File

@ -112,7 +112,7 @@ export class ThemePickerComponent {
];
constructor(public styleManager: StyleManager,
private _themeStorage: ThemeStorage) {
private themeStorage: ThemeStorage) {
}
@ -120,17 +120,17 @@ export class ThemePickerComponent {
if (theme.isDefault === true) {
this.styleManager.setStyle('theme', ``);
} else {
this.currentTheme = this._getCurrentThemeFromHref(theme.href);
this.currentTheme = this.getCurrentThemeFromHref(theme.href);
this.styleManager.setStyle('theme', theme.href);
if (this.currentTheme) {
this._themeStorage.storeTheme(this.currentTheme);
this.themeStorage.storeTheme(this.currentTheme);
}
}
}
private _getCurrentThemeFromHref(href: string): DocsSiteTheme {
private getCurrentThemeFromHref(href: string): DocsSiteTheme {
return this.themes.find((theme) => theme.href === href);
}
}

View File

@ -24,14 +24,14 @@ import { Observable, Subject } from 'rxjs';
interface ProcessServiceData {
rest: {
fields: Array<{
processId?: string,
taskId?: string,
fieldId?: string,
processId?: string;
taskId?: string;
fieldId?: string;
values?: Array<{
id: string,
name: string
}>
}>
id: string;
name: string;
}>;
}>;
};
}
//
@ -84,7 +84,7 @@ export class InMemoryFormService extends FormService {
const form = new FormModel(flattenForm, formValues, readOnly, this, prefixedSpace);
if (!json.fields) {
form.outcomes = [
new FormOutcomeModel(<any> form, {
new FormOutcomeModel(form, {
id: '$save',
name: FormOutcomeModel.SAVE_ACTION,
isSystem: true

View File

@ -1,5 +1,5 @@
/* SystemJS module definition */
declare var module: NodeModule;
declare const module: NodeModule;
interface NodeModule {
id: string;
}

View File

@ -0,0 +1,3 @@
{
"extends": "../tsconfig.json"
}

View File

@ -189,6 +189,7 @@ export class DataTablePage {
}
async getClipboardInputText(): Promise<string> {
return BrowserActions.getInputValue(this.pasteClipboardInput);
const inputValue = await BrowserActions.getInputValue(this.pasteClipboardInput);
return inputValue.match(/\d/).toString();
}
}

View File

@ -1,4 +1,8 @@
{
"C269081": "https://alfresco.atlassian.net/browse/ADF-5385",
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385"
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385",
"C260188": "https://alfresco.atlassian.net/browse/ADF-5470",
"C260192": "https://alfresco.atlassian.net/browse/ADF-5470",
"C260193": "https://alfresco.atlassian.net/browse/ADF-5470",
"C216426": "https://alfresco.atlassian.net/browse/ADF-5470"
}

View File

@ -1,10 +1,10 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true
},
"exclude": ["../**/*.spec.ts" ],
"include": ["../src/**/*", "*.js"]
}

112
lib/core/.eslintrc.json Normal file
View File

@ -0,0 +1,112 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"lib/core/tsconfig.lib.json",
"lib/core/tsconfig.spec.json"
],
"createDefaultProgram": true
},
"plugins": [
"eslint-plugin-unicorn",
"eslint-plugin-rxjs"
],
"rules": {
"jsdoc/newline-after-description": "warn",
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"no-underscore-dangle": "warn",
"no-shadow": "warn",
"quote-props": "warn",
"object-shorthand": "warn",
"prefer-const": "warn",
"arrow-body-style": "warn",
"@angular-eslint/no-output-native": "warn",
"space-before-function-paren": "warn",
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": [
"element",
"attribute"
],
"prefix": [
"adf",
"app"
],
"style": "kebab-case"
}
],
"@angular-eslint/no-host-metadata-property": "off",
"@angular-eslint/no-input-prefix": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "error",
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": "error",
"default-case": "error",
"import/order": "off",
"max-len": [
"error",
{
"code": 240
}
],
"no-bitwise": "off",
"no-duplicate-imports": "error",
"no-multiple-empty-lines": "error",
"no-redeclare": "error",
"no-return-await": "error",
"rxjs/no-create": "error",
"rxjs/no-subject-unsubscribe": "error",
"rxjs/no-subject-value": "error",
"rxjs/no-unsafe-takeuntil": "error",
"unicorn/filename-case": "error"
}
},
{
"files": [
"*.html"
],
"rules": {
"@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-positive-tabindex": "error",
"@angular-eslint/template/no-negated-async": "warn"
}
}
]
}

View File

@ -1,10 +1,10 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true
},
"exclude": ["../**/*.spec.ts" ],
"include": ["../**/*.ts", "*.js"]
}

View File

@ -23,7 +23,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Directive()
// tslint:disable-next-line: directive-class-suffix
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy {
@Input()

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { Component, Input, SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
@ -109,12 +109,12 @@ describe('CardViewItemDispatcherComponent', () => {
});
it('should update the subcomponent\'s input parameters', () => {
const expectedEditable = false,
expectedDisplayEmpty = true,
expectedProperty = <CardViewItem> {},
expectedCustomInput = 1,
expectedDisplayNoneOption = false,
expectedDisplayClearAction = false;
const expectedEditable = false;
const expectedDisplayEmpty = true;
const expectedProperty = <CardViewItem> {};
const expectedCustomInput = 1;
const expectedDisplayNoneOption = false;
const expectedDisplayClearAction = false;
component.ngOnChanges({
editable: new SimpleChange(true, expectedEditable, false),

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, Input, OnChanges, OnDestroy } from '@angular/core';
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model';
import { CardViewUpdateService } from '../../services/card-view-update.service';
import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
@ -30,7 +30,7 @@ import { takeUntil, map } from 'rxjs/operators';
templateUrl: './card-view-selectitem.component.html',
styleUrls: ['./card-view-selectitem.component.scss']
})
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnChanges, OnDestroy {
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnInit, OnChanges, OnDestroy {
static HIDE_FILTER_LIMIT = 5;
@Input() editable: boolean = false;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ViewEncapsulation, ViewChild, ElementRef, OnDestroy, Inject, Output, EventEmitter } from '@angular/core';
import { Component, ViewEncapsulation, ViewChild, ElementRef, OnDestroy, Inject, Output, EventEmitter, OnInit } from '@angular/core';
import { ESCAPE, TAB } from '@angular/cdk/keycodes';
import { MatSelect } from '@angular/material/select';
import { Subject } from 'rxjs';
@ -28,7 +28,7 @@ import { takeUntil } from 'rxjs/operators';
host: { 'class': 'adf-select-filter-input' },
encapsulation: ViewEncapsulation.None
})
export class SelectFilterInputComponent implements OnDestroy {
export class SelectFilterInputComponent implements OnInit, OnDestroy {
@ViewChild('selectFilterInput', { read: ElementRef, static: false }) selectFilterInput: ElementRef;
@Output() change = new EventEmitter<string>();

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ChangeDetectorRef, Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
import { CardViewUpdateService } from '../../services/card-view-update.service';
import { BaseCardView } from '../base-card-view';
@ -42,7 +42,7 @@ const templateTypes = {
styleUrls: ['./card-view-textitem.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemModel> implements OnChanges {
export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemModel> implements OnChanges, OnDestroy {
@Input()
editable: boolean = false;
@ -92,7 +92,11 @@ export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemMode
this.setTemplateType();
if (changes.editable) {
this.isEditable ? this.textInput.enable() : this.textInput.disable();
if (this.isEditable) {
this.textInput.enable();
} else {
this.textInput.disable();
}
}
}

View File

@ -95,7 +95,7 @@ describe('CardViewBaseItemModel', () => {
expect(validator2.isValid).toHaveBeenCalledWith('test-against-this');
});
it("should return the registered validators' common decision (case true)", () => {
it('should return the registered validators common decision (case true)', () => {
const validator1: CardViewItemValidator = { isValid: () => true, message: 'validator 1' };
const validator2: CardViewItemValidator = { isValid: () => true, message: 'validator 2' };
properties.validators = [validator1, validator2];
@ -107,7 +107,7 @@ describe('CardViewBaseItemModel', () => {
expect(itemModel.getValidationErrors('test-against-this')).toEqual([]);
});
it("should return the registered validators' common decision (case false)", () => {
it('should return the registered validators common decision (case false)', () => {
const validator1: CardViewItemValidator = { isValid: () => false, message: 'validator 1' };
const validator2: CardViewItemValidator = { isValid: () => true, message: 'validator 2' };
const validator3: CardViewItemValidator = { isValid: () => false, message: 'validator 3' };

View File

@ -30,7 +30,7 @@ import { CardViewArrayItemComponent } from '../components/card-view-arrayitem/ca
})
export class CardItemTypeService extends DynamicComponentMapper {
protected defaultValue: Type<{}> = CardViewTextItemComponent;
protected defaultValue: Type<any> = CardViewTextItemComponent;
protected types: { [key: string]: DynamicComponentResolveFunction } = {
'text': DynamicComponentResolver.fromType(CardViewTextItemComponent),

View File

@ -29,10 +29,10 @@ export interface ClickNotification {
target: any;
}
export function transformKeyToObject(key: string, value): Object {
export function transformKeyToObject(key: string, value): any {
const objectLevels: string[] = key.split('.').reverse();
return objectLevels.reduce<{}>((previousValue, currentValue) => {
return objectLevels.reduce<any>((previousValue, currentValue) => {
return { [currentValue]: previousValue};
}, value);
}

View File

@ -24,7 +24,7 @@ import { ClipboardService } from './clipboard.service';
})
export class ClipboardDirective {
/** Translation key or message for the tooltip. */
// tslint:disable-next-line:no-input-rename
// eslint-disable-next-line @angular-eslint/no-input-rename
@Input('adf-clipboard')
placeholder: string;
@ -33,7 +33,7 @@ export class ClipboardDirective {
target: HTMLInputElement | HTMLTextAreaElement;
/** Translation key or message for snackbar notification. */
// tslint:disable-next-line:no-input-rename
// eslint-disable-next-line @angular-eslint/no-input-rename
@Input('clipboard-notification') message: string;
constructor(private clipboardService: ClipboardService,

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, HostListener, Input } from '@angular/core';
import { ContextMenuOverlayService } from './context-menu-overlay.service';

View File

@ -15,16 +15,16 @@
* limitations under the License.
*/
/* tslint:disable:component-selector no-input-rename */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
import { Component, ContentChild, TemplateRef } from '@angular/core';
import { AfterContentInit, Component, ContentChild, TemplateRef } from '@angular/core';
import { DataColumnComponent } from './data-column.component';
@Component({
selector: 'adf-data-column-header',
template: ''
})
export class DateColumnHeaderComponent {
export class DateColumnHeaderComponent implements AfterContentInit {
@ContentChild(TemplateRef)
public header: TemplateRef<any>;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { Component, ContentChildren, QueryList } from '@angular/core';
import { DataColumnComponent } from './data-column.component';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector no-input-rename */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
@ -56,7 +56,7 @@ export class DataColumnComponent implements OnInit {
/** Custom tooltip formatter function. */
@Input()
formatTooltip: Function;
formatTooltip: (...args) => string;
/** Title to be used for screen readers. */
@Input('sr-title')

View File

@ -1090,7 +1090,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'material-icons://android';
}
};
@ -1102,7 +1102,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'http://www.google.com';
}
};
@ -1114,7 +1114,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'material-icons://android';
}
};
@ -1126,7 +1126,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'http://www.google.com';
}
};
@ -1229,7 +1229,7 @@ describe('DataTable', () => {
const column = <DataColumn> {};
const row: any = {
getValue: function () {
getValue: function() {
return 'id';
}
};

View File

@ -15,10 +15,12 @@
* limitations under the License.
*/
/* eslint-disable @angular-eslint/no-conflicting-lifecycle */
import {
ViewChildren, QueryList, HostListener,
AfterContentInit, Component, ContentChild, DoCheck, ElementRef, EventEmitter, Input,
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation, OnDestroy
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation, OnDestroy, AfterViewInit
} from '@angular/core';
import { FocusKeyManager } from '@angular/cdk/a11y';
import { MatCheckboxChange } from '@angular/material/checkbox';
@ -57,7 +59,7 @@ export enum ShowHeaderMode {
encapsulation: ViewEncapsulation.None,
host: { class: 'adf-datatable' }
})
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, OnDestroy {
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, OnDestroy, AfterViewInit {
@ViewChildren(DataTableRowComponent)
rowsList: QueryList<DataTableRowComponent>;
@ -122,7 +124,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
* docs for more details and usage examples.
*/
@Input()
rowStyle: { [key: string]: any; };
rowStyle: { [key: string]: any };
/** The CSS class to apply to every row. */
@Input()
@ -203,7 +205,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
private click$: Observable<DataRowEvent>;
private differ: any;
private rowMenuCache: object = {};
private rowMenuCache: any = {};
private subscriptions: Subscription[] = [];
private singleClickStreamSub: Subscription;
@ -856,7 +858,7 @@ export interface DataTableDropEvent {
target: 'cell' | 'header';
event: Event;
column: DataColumn;
row?: DataRow
row?: DataRow;
};
preventDefault(): void;

View File

@ -57,7 +57,7 @@ export class JsonCellComponent extends DataTableCellComponent implements OnInit
}
view() {
const rawValue: string | object = this.data.getValue(this.row, this.column, this.resolverFn);
const rawValue: string | any = this.data.getValue(this.row, this.column, this.resolverFn);
const value = typeof rawValue === 'object'
? JSON.stringify(rawValue || {}, null, 2)
: rawValue;

View File

@ -38,7 +38,7 @@ export interface DataColumn {
srTitle?: string;
cssClass?: string;
template?: TemplateRef<any>;
formatTooltip?: Function;
formatTooltip?: (...args) => string;
copyContent?: boolean;
editable?: boolean;
focus?: boolean;

View File

@ -22,7 +22,7 @@ import { DataColumn } from './data-column.model';
import { ObjectDataColumn } from './object-datacolumn.model';
@Directive()
// tslint:disable-next-line: directive-class-suffix
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class DataTableSchema {
@ContentChild(DataColumnListComponent)

View File

@ -136,12 +136,16 @@ describe('ObjectDataTableAdapter', () => {
it('should fail getting value with row not defined', () => {
const adapter = new ObjectDataTableAdapter([], []);
expect(() => { adapter.getValue(null, null); }).toThrowError('Row not found');
expect(() => {
adapter.getValue(null, null);
}).toThrowError('Row not found');
});
it('should fail getting value with column not defined', () => {
const adapter = new ObjectDataTableAdapter([], []);
expect(() => { adapter.getValue(<DataRow> {}, null); }).toThrowError('Column not found');
expect(() => {
adapter.getValue(<DataRow> {}, null);
}).toThrowError('Column not found');
});
it('should get value from row with column key', () => {
@ -300,7 +304,9 @@ describe('ObjectDataTableAdapter', () => {
describe('ObjectDataRow', () => {
it('should require object source', () => {
expect(() => { return new ObjectDataRow(null); }).toThrowError('Object source not found');
expect(() => {
return new ObjectDataRow(null);
}).toThrowError('Object source not found');
});
it('should get top level property value', () => {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { ChangeDetectorRef, Directive, ElementRef, Host, Inject, Input, OnChanges, Optional, Renderer2, SimpleChanges } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, ElementRef, Input, Renderer2, AfterViewChecked } from '@angular/core';
import { HighlightTransformService, HighlightTransformResult } from '../services/highlight-transform.service';

View File

@ -34,7 +34,7 @@ export class LibraryFavoriteDirective implements OnChanges {
library: LibraryEntity = null;
@Output() toggle = new EventEmitter<any>();
// tslint:disable-next-line: no-output-native
// eslint-disable-next-line @angular-eslint/no-output-native
@Output() error = new EventEmitter<any>();
private targetLibrary = null;

View File

@ -149,7 +149,7 @@ describe('LibraryMembershipDirective', () => {
expect(deleteMembershipSpy).not.toHaveBeenCalled();
}));
it("should add 'workspace' to send appropriate email", fakeAsync(() => {
it(`should add 'workspace' to send appropriate email`, fakeAsync(() => {
mockSupportedVersion = true;
const selection = { entry: { id: 'no-membership-requested' } };
const change = new SimpleChange(null, selection, true);

View File

@ -65,7 +65,7 @@ export class LibraryMembershipDirective implements OnChanges {
@Output()
toggle = new EventEmitter<LibraryMembershipToggleEvent>();
// tslint:disable-next-line: no-output-native
// eslint-disable-next-line @angular-eslint/no-output-native
@Output()
error = new EventEmitter<LibraryMembershipErrorEvent>();

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
@ -185,6 +185,7 @@ export class NodeDeleteDirective implements OnChanges {
if (status.allFailed && !status.oneFailed) {
return this.translation.instant(
'CORE.DELETE_NODE.ERROR_PLURAL',
// eslint-disable-next-line id-blacklist
{ number: status.failed.length }
);
}
@ -192,6 +193,7 @@ export class NodeDeleteDirective implements OnChanges {
if (status.allSucceeded && !status.oneSucceeded) {
return this.translation.instant(
'CORE.DELETE_NODE.PLURAL',
// eslint-disable-next-line id-blacklist
{ number: status.success.length }
);
}

View File

@ -26,7 +26,7 @@ import { DownloadService } from '../services/download.service';
* Directive selectors without adf- prefix will be deprecated on 3.0.0
*/
@Directive({
// tslint:disable-next-line: directive-selector
// eslint-disable-next-line @angular-eslint/directive-selector
selector: '[adfNodeDownload]'
})
export class NodeDownloadDirective {
@ -110,7 +110,8 @@ export class NodeDownloadDirective {
// nodeId for Shared node
const id = (<any> node.entry).nodeId || node.entry.id;
let url, fileName;
let url;
let fileName;
if (this.version) {
url = this.contentApi.getVersionContentUrl(id, this.version.entry.id, true);
fileName = this.version.entry.name;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
import { FavoriteBody, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi } from '@alfresco/js-api';

View File

@ -69,7 +69,9 @@ describe('NodeRestoreDirective', () => {
}));
translationService = TestBed.inject(TranslationService);
spyOn(translationService, 'instant').and.callFake((key) => { return key; });
spyOn(translationService, 'instant').and.callFake((key) => {
return key;
});
});
it('should not restore when selection is empty', () => {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector no-input-rename */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from '@alfresco/js-api';
@ -194,6 +194,7 @@ export class NodeRestoreDirective {
return this.translation.instant(
'CORE.RESTORE_NODE.PARTIAL_PLURAL',
{
// eslint-disable-next-line id-blacklist
number: status.fail.length
}
);

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:no-input-rename */
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, ElementRef, HostListener, Input, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { FileInfo, FileUtils } from '../utils/file-utils';

View File

@ -20,7 +20,7 @@ import { EventEmitter, Input, Output, Directive } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
@Directive()
// tslint:disable-next-line: directive-class-suffix
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class FormBaseComponent {
static SAVE_OUTCOME_ID: string = '$save';

View File

@ -35,7 +35,7 @@ import { WidgetVisibilityService } from './../../services/widget-visibility.serv
import { FormFieldModel } from './../widgets/core/form-field.model';
import { WidgetComponent } from './../widgets/widget.component';
declare var adf: any;
declare const adf: any;
@Component({
selector: 'adf-form-field',
@ -63,7 +63,7 @@ export class FormFieldComponent implements OnInit, OnDestroy {
@Input()
field: FormFieldModel = null;
componentRef: ComponentRef<{}>;
componentRef: ComponentRef<any>;
focus: boolean = false;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { Component, OnInit, ViewEncapsulation, InjectionToken, Inject, Optional } from '@angular/core';
import { FormService } from './../../../services/form.service';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector no-input-rename */
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
import { Component, ViewEncapsulation } from '@angular/core';
import { FormService } from './../../../services/form.service';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { ContainerColumnModel } from './../core/container-column.model';
import { ContainerModel } from './../core/container.model';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { AfterViewInit, Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormService } from './../../../services/form.service';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export class ContainerColumnModel {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { FormFieldModel } from './form-field.model';
import { FormWidgetModel } from './form-widget.model';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { RelatedContentRepresentation } from '@alfresco/js-api';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface DisplayableCMProperties {
name?: string;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export class ErrorMessageModel {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface ExternalContentLink {
contentAvailable: boolean;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface ExternalContent {
folder: boolean;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { FormFieldSelectedFolder } from './form-field-selected-folder';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { DisplayableCMProperties } from './displayable-cm-properties.model';
import { FormFieldFileSource } from './form-field-file-source';
@ -31,10 +31,10 @@ export interface FormFieldMetadata {
};
responseVariable?: boolean;
menuOptions?: {
show?: boolean,
download?: boolean,
retrieveMetadata?: boolean,
remove?: boolean
show?: boolean;
download?: boolean;
retrieveMetadata?: boolean;
remove?: boolean;
};
displayableCMProperties?: DisplayableCMProperties[];
}

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface FormFieldOption {
id: string;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface FormFieldSelectedFolder {
accountId: string;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export interface FormFieldTemplates {
[key: string]: string;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export class FormFieldTypes {
static CONTAINER: string = 'container';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import moment from 'moment-es6';
import { FormFieldTypes } from './form-field-types';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import moment from 'moment-es6';
import { WidgetVisibilityModel } from '../../../models/widget-visibility.model';
import { ContainerColumnModel } from './container-column.model';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { FormOutcomeModel } from './form-outcome.model';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { FormWidgetModel } from './form-widget.model';
import { WidgetVisibilityModel } from './../../../models/widget-visibility.model';

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
/* tslint:disable */
/* eslint-disable */
import { FormFieldMetadata } from './form-field-metadata';
export interface FormValues extends FormFieldMetadata {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export abstract class FormWidgetModel {

View File

@ -43,7 +43,7 @@ export interface FormRepresentationModel {
taskName?: string;
processDefinitionId?: string;
customFieldTemplates?: {
[key: string]: string
[key: string]: string;
};
selectedOutcome?: string;
fields?: any[];

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
export * from './form-field-metadata';
export * from './form-values';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
/* tslint:disable:component-selector */
/* eslint-disable @angular-eslint/component-selector */
import { WidgetVisibilityModel } from '../../../models/widget-visibility.model';
import { FormWidgetModel } from './form-widget.model';

Some files were not shown because too many files have changed in this diff Show More