mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-859] add codelyzer in core and datatable (#2056)
* add codelyzer in core and datatable * add codelyzer in the main build * order imports * fix import in test * fix import test * import reorder form * tasklist and processlist import reorder
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { AdfEmptyList } from './adf-empty-list.component';
|
||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import { AdfEmptyListComponent } from './adf-empty-list.component';
|
||||
|
||||
describe('AdfEmptyListComponent', () => {
|
||||
let component: AdfEmptyList;
|
||||
let fixture: ComponentFixture<AdfEmptyList>;
|
||||
describe('AdfEmptyListComponentComponent', () => {
|
||||
let component: AdfEmptyListComponent;
|
||||
let fixture: ComponentFixture<AdfEmptyListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -29,11 +29,11 @@ describe('AdfEmptyListComponent', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
AdfEmptyList
|
||||
AdfEmptyListComponent
|
||||
]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdfEmptyList);
|
||||
fixture = TestBed.createComponent(AdfEmptyListComponent);
|
||||
component = fixture.componentInstance;
|
||||
}));
|
||||
|
||||
|
@@ -22,7 +22,7 @@ import { Component, Input } from '@angular/core';
|
||||
styleUrls: ['./adf-empty-list.component.css'],
|
||||
templateUrl: './adf-empty-list.component.html'
|
||||
})
|
||||
export class AdfEmptyList {
|
||||
export class AdfEmptyListComponent {
|
||||
|
||||
@Input()
|
||||
emptyListImageUrl: string = require('../../assets/images/empty_doc_lib.svg');
|
||||
|
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { DataTableAdapter, DataColumn, DataRow } from '../../data/datatable-adapter';
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { DataColumn, DataRow, DataTableAdapter } from '../../data/datatable-adapter';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-datatable-cell, alfresco-datatable-cell',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: '<ng-container>{{value}}</ng-container>'
|
||||
})
|
||||
export class DataTableCellComponent {
|
||||
export class DataTableCellComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
data: DataTableAdapter;
|
||||
|
@@ -40,7 +40,7 @@
|
||||
<!-- Actions (left) -->
|
||||
<td *ngIf="actions && actionsPosition === 'left'" class="alfresco-datatable__actions-cell">
|
||||
<button [id]="'action_menu_' + idx" alfresco-mdl-button class="mdl-button--icon"
|
||||
[attr.data-automation-id]="actions_menu">
|
||||
[attr.data-automation-id]="'action_menu_' + idx">
|
||||
<i class="material-icons">more_vert</i>
|
||||
</button>
|
||||
<ul alfresco-mdl-menu class="mdl-menu--bottom-left"
|
||||
@@ -103,7 +103,7 @@
|
||||
<!-- Actions (right) -->
|
||||
<td *ngIf="actions && actionsPosition === 'right'" class="alfresco-datatable__actions-cell">
|
||||
<button [id]="'action_menu_' + idx" alfresco-mdl-button class="mdl-button--icon"
|
||||
[attr.data-automation-id]="actions_menu">
|
||||
[attr.data-automation-id]="'action_menu_' + idx">
|
||||
<i class="material-icons">more_vert</i>
|
||||
</button>
|
||||
<ul alfresco-mdl-menu class="mdl-menu--bottom-right"
|
||||
|
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MdCheckboxChange, MdCheckboxModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { MdCheckboxModule, MdCheckboxChange } from '@angular/material';
|
||||
import { DataTableComponent } from './datatable.component';
|
||||
import { DataTableCellComponent } from './datatable-cell.component';
|
||||
import {
|
||||
DataRow,
|
||||
DataColumn,
|
||||
DataRow,
|
||||
DataSorting,
|
||||
ObjectDataTableAdapter,
|
||||
ObjectDataColumn
|
||||
ObjectDataColumn,
|
||||
ObjectDataTableAdapter
|
||||
} from './../../data/index';
|
||||
import { DataTableCellComponent } from './datatable-cell.component';
|
||||
import { DataTableComponent } from './datatable.component';
|
||||
|
||||
describe('DataTable', () => {
|
||||
|
||||
|
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
Component, OnChanges, DoCheck, IterableDiffers, SimpleChange, SimpleChanges, Input,
|
||||
Output, EventEmitter, ElementRef, TemplateRef, AfterContentInit, ContentChild, Optional
|
||||
AfterContentInit, AfterViewInit, Component, ContentChild, DoCheck, ElementRef, EventEmitter, Input,
|
||||
IterableDiffers, OnChanges, Optional, Output, SimpleChange, SimpleChanges, TemplateRef
|
||||
} from '@angular/core';
|
||||
import { DataTableAdapter, DataRow, DataColumn, DataSorting, DataRowEvent } from '../../data/datatable-adapter';
|
||||
import { ObjectDataTableAdapter, ObjectDataRow } from '../../data/object-datatable-adapter';
|
||||
import { MdCheckboxChange } from '@angular/material';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { DataColumn, DataRow, DataRowEvent, DataSorting, DataTableAdapter } from '../../data/datatable-adapter';
|
||||
import { ObjectDataRow, ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
||||
import { DataCellEvent } from './data-cell.event';
|
||||
import { DataRowActionEvent } from './data-row-action.event';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { MdCheckboxChange } from '@angular/material';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
|
||||
declare var componentHandler;
|
||||
|
||||
@@ -34,7 +34,7 @@ declare var componentHandler;
|
||||
styleUrls: ['./datatable.component.css'],
|
||||
templateUrl: './datatable.component.html'
|
||||
})
|
||||
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck {
|
||||
export class DataTableComponent implements AfterContentInit, AfterViewInit, OnChanges, DoCheck {
|
||||
|
||||
@ContentChild(DataColumnListComponent) columnList: DataColumnListComponent;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<div class="mdl-paging">
|
||||
<span class="mdl-paging__per-page">
|
||||
<span class="mdl-paging__per-page-label">Rows per page:</span>
|
||||
<span class="mdl-paging__per-page-value" [attr.data-automation-id]="'rows_per_page_' + pageSize">{{pagination.maxItems}}</span>
|
||||
<span class="mdl-paging__per-page-value" >{{pagination.maxItems}}</span>
|
||||
|
||||
<md-menu #appMenu="mdMenu" for="pageSizePicker">
|
||||
<div *ngFor="let size of supportedPageSizes"
|
||||
@@ -16,12 +16,12 @@
|
||||
<span class="mdl-paging__count">{{summary}}</span>
|
||||
<button (click)="showPrevPage()"
|
||||
[disabled]="!prevPageAvail()"
|
||||
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev" [attr.data-automation-id]="prev_page">
|
||||
alfresco-mdl-button class="mdl-button--icon mdl-paging__prev">
|
||||
<i class="material-icons">keyboard_arrow_left</i>
|
||||
</button>
|
||||
<button (click)="showNextPage()"
|
||||
[disabled]="!nextPageAvail()"
|
||||
alfresco-mdl-button class="mdl-button--icon mdl-paging__next" [attr.data-automation-id]="next_page">
|
||||
alfresco-mdl-button class="mdl-button--icon mdl-paging__next">
|
||||
<i class="material-icons">keyboard_arrow_right</i>
|
||||
</button>
|
||||
</div>
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PaginationComponent } from '../pagination/pagination.component';
|
||||
import { PaginationData } from '../../models/pagination.data';
|
||||
import { Injector, SimpleChange } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { PaginationData } from '../../models/pagination.data';
|
||||
import { PaginationComponent } from '../pagination/pagination.component';
|
||||
|
||||
describe('PaginationComponent', () => {
|
||||
let injector: Injector;
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SimpleChanges, OnChanges, EventEmitter, Output, Component, Input, OnInit } from '@angular/core';
|
||||
import { PaginationData } from '../../models/pagination.data';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { PaginationData } from '../../models/pagination.data';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-pagination, alfresco-pagination',
|
||||
@@ -28,7 +28,7 @@ export class PaginationComponent implements OnInit, OnChanges {
|
||||
|
||||
static DEFAULT_PAGE_SIZE: number = 20;
|
||||
|
||||
private summary: string = '';
|
||||
summary: string = '';
|
||||
|
||||
@Input()
|
||||
supportedPageSizes: number[] = [5, 10, 20, 50, 100];
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, DataSorting } from './datatable-adapter';
|
||||
import { ObjectDataTableAdapter, ObjectDataRow, ObjectDataColumn } from './object-datatable-adapter';
|
||||
import { ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from './object-datatable-adapter';
|
||||
|
||||
describe('ObjectDataTableAdapter', () => {
|
||||
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { TemplateRef } from '@angular/core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { TemplateRef } from '@angular/core';
|
||||
import { ObjectUtils } from 'ng2-alfresco-core';
|
||||
import { DataTableAdapter, DataRow, DataColumn, DataSorting } from './datatable-adapter';
|
||||
import { DataColumn, DataRow, DataSorting, DataTableAdapter } from './datatable-adapter';
|
||||
|
||||
declare var require: any;
|
||||
|
||||
|
@@ -15,27 +15,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoadingContentTemplateComponent } from './loading-template.component';
|
||||
import { Injector } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
import { LoadingContentTemplateDirective } from './loading-template.directive';
|
||||
|
||||
describe('LoadingContentTemplateComponent', () => {
|
||||
describe('LoadingContentTemplateDirective', () => {
|
||||
let injector: Injector;
|
||||
let loadingContentTemplateComponent: LoadingContentTemplateComponent;
|
||||
let loadingContentTemplateDirective: LoadingContentTemplateDirective;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
LoadingContentTemplateComponent,
|
||||
LoadingContentTemplateDirective,
|
||||
DataTableComponent
|
||||
]
|
||||
});
|
||||
injector = getTestBed();
|
||||
loadingContentTemplateComponent = injector.get(LoadingContentTemplateComponent);
|
||||
loadingContentTemplateDirective = injector.get(LoadingContentTemplateDirective);
|
||||
});
|
||||
|
||||
it('is defined', () => {
|
||||
expect(loadingContentTemplateComponent).toBeDefined();
|
||||
expect(loadingContentTemplateDirective).toBeDefined();
|
||||
});
|
||||
});
|
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, ContentChild, TemplateRef, AfterContentInit } from '@angular/core';
|
||||
import { AfterContentInit, ContentChild, Directive, TemplateRef } from '@angular/core';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
|
||||
@Directive({
|
||||
selector: 'loading-content-template'
|
||||
})
|
||||
export class LoadingContentTemplateComponent implements AfterContentInit {
|
||||
export class LoadingContentTemplateDirective implements AfterContentInit {
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
@@ -15,27 +15,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NoContentTemplateComponent } from './no-content-template.component';
|
||||
import { Injector } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
import { NoContentTemplateDirective } from './no-content-template.directive';
|
||||
|
||||
describe('NoContentTemplateComponent', () => {
|
||||
describe('NoContentTemplateDirective', () => {
|
||||
let injector: Injector;
|
||||
let noContentTemplateComponent: NoContentTemplateComponent;
|
||||
let noContentTemplateDirective: NoContentTemplateDirective;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
NoContentTemplateComponent,
|
||||
NoContentTemplateDirective,
|
||||
DataTableComponent
|
||||
]
|
||||
});
|
||||
injector = getTestBed();
|
||||
noContentTemplateComponent = injector.get(NoContentTemplateComponent);
|
||||
noContentTemplateDirective = injector.get(NoContentTemplateDirective);
|
||||
});
|
||||
|
||||
it('is defined', () => {
|
||||
expect(noContentTemplateComponent).toBeDefined();
|
||||
expect(noContentTemplateDirective).toBeDefined();
|
||||
});
|
||||
});
|
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, ContentChild, TemplateRef, AfterContentInit } from '@angular/core';
|
||||
import { AfterContentInit, ContentChild, Directive, TemplateRef } from '@angular/core';
|
||||
import { DataTableComponent } from '../components/datatable/datatable.component';
|
||||
|
||||
@Directive({
|
||||
selector: 'no-content-template'
|
||||
})
|
||||
export class NoContentTemplateComponent implements AfterContentInit {
|
||||
export class NoContentTemplateDirective implements AfterContentInit {
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MdCheckboxModule, MdMenuModule, MdIconModule, MdButtonModule } from '@angular/material';
|
||||
import { MdButtonModule, MdCheckboxModule, MdIconModule, MdMenuModule } from '@angular/material';
|
||||
|
||||
export function modules() {
|
||||
return [
|
||||
|
Reference in New Issue
Block a user