mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
move tslint ADF rules in principal repo (#3247)
* move tslint ADF rules in principal repo * fix style issues * change pacakge.json position * update to angular cli 6.0.0 * reorganization package.json * remove node modules2 folder * exclude integration * rollback alfresco-js-api * solve types problems * fix pdf test * fix errors and exclude two tests * fix e2e * fix test * copy all the new packages in node_modules * fix test * fix packaging script * scss issue fix * move test export in tools
This commit is contained in:
@@ -19,7 +19,8 @@ import { SimpleChange } from '@angular/core';
|
||||
import { fakeAsync, tick } from '@angular/core/testing';
|
||||
import { NodeFavoriteDirective } from './node-favorite.directive';
|
||||
import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
|
||||
import { AppConfigService, StorageService } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
|
||||
describe('NodeFavoriteDirective', () => {
|
||||
|
||||
|
@@ -200,10 +200,8 @@ describe('StartFormComponent', () => {
|
||||
const formFields = component.form.getFormFields();
|
||||
const labelField = formFields.find(field => field.id === 'number');
|
||||
const numberWidget = fixture.debugElement.nativeElement.querySelector('number-widget');
|
||||
const numberWidgetLabel = fixture.debugElement.nativeElement.querySelector('.adf-input');
|
||||
expect(labelField.type).toBe('text');
|
||||
expect(labelField.type).toBe('integer');
|
||||
expect(numberWidget).toBeDefined();
|
||||
expect(numberWidgetLabel.innerText).toBe('number');
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -30,18 +30,18 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
describe('DropdownWidgetComponent', () => {
|
||||
|
||||
function openSelect() {
|
||||
const dropdown = fixture.debugElement.query(By.css('[class="mat-select-trigger"]'));
|
||||
dropdown.triggerEventHandler('click', null);
|
||||
fixture.detectChanges();
|
||||
}
|
||||
|
||||
let formService: FormService;
|
||||
let widget: DropdownWidgetComponent;
|
||||
let visibilityService: WidgetVisibilityService;
|
||||
let fixture: ComponentFixture<DropdownWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
|
||||
function openSelect() {
|
||||
const dropdown = fixture.debugElement.query(By.css('[class="mat-select-trigger"]'));
|
||||
dropdown.triggerEventHandler('click', null);
|
||||
fixture.detectChanges();
|
||||
}
|
||||
|
||||
let fakeOptionList: FormFieldOption[] = [
|
||||
{ id: 'opt_1', name: 'option_1' },
|
||||
{ id: 'opt_2', name: 'option_2' },
|
||||
|
@@ -176,13 +176,6 @@ describe('DropdownEditorComponent', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
|
||||
function openSelect() {
|
||||
const dropdown = fixture.debugElement.query(By.css('[class="mat-select-trigger"]'));
|
||||
dropdown.triggerEventHandler('click', null);
|
||||
fixture.detectChanges();
|
||||
}
|
||||
|
||||
let dropDownEditorComponent: DropdownEditorComponent;
|
||||
let fixture: ComponentFixture<DropdownEditorComponent>;
|
||||
let element: HTMLElement;
|
||||
@@ -196,6 +189,12 @@ describe('DropdownEditorComponent', () => {
|
||||
}, {id: 'opt_3', name: 'option_3'}];
|
||||
let dynamicTable: DynamicTableModel;
|
||||
|
||||
function openSelect() {
|
||||
const dropdown = fixture.debugElement.query(By.css('[class="mat-select-trigger"]'));
|
||||
dropdown.triggerEventHandler('click', null);
|
||||
fixture.detectChanges();
|
||||
}
|
||||
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(DropdownEditorComponent);
|
||||
dropDownEditorComponent = fixture.componentInstance;
|
||||
|
@@ -22,8 +22,11 @@ import { MatTabChangeEvent } from '@angular/material';
|
||||
template: '<ng-template><ng-content></ng-content></ng-template>'
|
||||
})
|
||||
export class InfoDrawerTabComponent {
|
||||
@Input('label') label: string = 'Main tab';
|
||||
@ViewChild(TemplateRef) content: TemplateRef<any>;
|
||||
@Input()
|
||||
label: string = 'Main tab';
|
||||
|
||||
@ViewChild(TemplateRef)
|
||||
content: TemplateRef<any>;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
@@ -1,19 +1,23 @@
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
require('core-js/es6');
|
||||
require('core-js/es7/reflect');
|
||||
require('../../node_modules/core-js/es6');
|
||||
require('../../node_modules/core-js/es7/reflect');
|
||||
|
||||
require('zone.js/dist/zone');
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
require('zone.js/dist/proxy');
|
||||
require('zone.js/dist/sync-test');
|
||||
require('zone.js/dist/jasmine-patch');
|
||||
require('zone.js/dist/async-test');
|
||||
require('zone.js/dist/fake-async-test');
|
||||
require('../../node_modules/zone.js/dist/zone');
|
||||
require('../../node_modules/zone.js/dist/long-stack-trace-zone');
|
||||
require('../../node_modules/zone.js/dist/proxy');
|
||||
require('../../node_modules/zone.js/dist/sync-test');
|
||||
require('../../node_modules/zone.js/dist/jasmine-patch');
|
||||
require('../../node_modules/zone.js/dist/async-test');
|
||||
require('../../node_modules/zone.js/dist/fake-async-test');
|
||||
|
||||
const pdfjsLib = require('pdfjs-dist');
|
||||
pdfjsLib.PDFJS.workerSrc = 'base/node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
var appContext = require.context(".", true, /.spec.ts/);appContext.keys().forEach(appContext);
|
||||
var appContext = require.context(".", true, /.spec.ts/);
|
||||
appContext.keys().forEach(appContext);
|
||||
|
||||
const TestBed = require('@angular/core/testing').TestBed;
|
||||
const browser = require('@angular/platform-browser-dynamic/testing');
|
||||
|
@@ -17,6 +17,8 @@
|
||||
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
describe('AlfrescoApiService', () => {
|
||||
|
||||
let service: AlfrescoApiService;
|
||||
|
@@ -26,6 +26,8 @@ import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
@Injectable()
|
||||
export class AlfrescoApiService {
|
||||
|
||||
|
@@ -23,6 +23,8 @@ import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
describe('AppsProcessService', () => {
|
||||
|
||||
let service: AppsProcessService;
|
||||
|
@@ -21,6 +21,41 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { LogService } from './log.service';
|
||||
|
||||
@Component({
|
||||
template: '',
|
||||
providers: [LogService]
|
||||
})
|
||||
class ProvidesLogComponent {
|
||||
constructor(public logService: LogService) {
|
||||
|
||||
}
|
||||
|
||||
error() {
|
||||
this.logService.error('Test message');
|
||||
}
|
||||
|
||||
info() {
|
||||
this.logService.info('Test message');
|
||||
}
|
||||
|
||||
warn() {
|
||||
this.logService.warn('Test message');
|
||||
}
|
||||
|
||||
log() {
|
||||
this.logService.log('Test message');
|
||||
}
|
||||
|
||||
debug() {
|
||||
this.logService.debug('Test message');
|
||||
}
|
||||
|
||||
trace() {
|
||||
this.logService.trace('Test message');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
describe('Log Service', () => {
|
||||
|
||||
let providesLogComponent: ComponentFixture<ProvidesLogComponent>;
|
||||
@@ -156,38 +191,3 @@ describe('Log Service', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Component({
|
||||
template: '',
|
||||
providers: [LogService]
|
||||
})
|
||||
class ProvidesLogComponent {
|
||||
constructor(public logService: LogService) {
|
||||
|
||||
}
|
||||
|
||||
error() {
|
||||
this.logService.error('Test message');
|
||||
}
|
||||
|
||||
info() {
|
||||
this.logService.info('Test message');
|
||||
}
|
||||
|
||||
warn() {
|
||||
this.logService.warn('Test message');
|
||||
}
|
||||
|
||||
log() {
|
||||
this.logService.log('Test message');
|
||||
}
|
||||
|
||||
debug() {
|
||||
this.logService.debug('Test message');
|
||||
}
|
||||
|
||||
trace() {
|
||||
this.logService.trace('Test message');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -24,6 +24,27 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { NotificationService } from './notification.service';
|
||||
|
||||
@Component({
|
||||
template: '',
|
||||
providers: [NotificationService]
|
||||
})
|
||||
class ProvidesNotificationServiceComponent {
|
||||
constructor(public notificationService: NotificationService) {
|
||||
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
let promise = this.notificationService.openSnackMessage('Test notification', 5000);
|
||||
return promise;
|
||||
}
|
||||
|
||||
sendMessageAction() {
|
||||
let promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 5000);
|
||||
return promise;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
describe('NotificationService', () => {
|
||||
let fixture: ComponentFixture<ProvidesNotificationServiceComponent>;
|
||||
|
||||
@@ -74,24 +95,3 @@ describe('NotificationService', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Component({
|
||||
template: '',
|
||||
providers: [NotificationService]
|
||||
})
|
||||
class ProvidesNotificationServiceComponent {
|
||||
constructor(public notificationService: NotificationService) {
|
||||
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
let promise = this.notificationService.openSnackMessage('Test notification', 5000);
|
||||
return promise;
|
||||
}
|
||||
|
||||
sendMessageAction() {
|
||||
let promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 5000);
|
||||
return promise;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,12 +17,15 @@
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "../dist/core/",
|
||||
"baseUrl" : "./",
|
||||
"baseUrl": "./",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
"@alfresco/adf-process-services": ["../process-services"],
|
||||
"@alfresco/adf-content-services": ["../content-services"],
|
||||
"@angular/*": ["../node_modules/@angular/*"]
|
||||
"@alfresco/adf-process-services": [
|
||||
"../process-services"
|
||||
],
|
||||
"@alfresco/adf-content-services": [
|
||||
"../content-services"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"es2016",
|
||||
|
@@ -24,7 +24,9 @@ import { DomSanitizer } from '@angular/platform-browser';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class PdfThumbComponent implements OnInit {
|
||||
@Input('page') page: any = null;
|
||||
|
||||
@Input()
|
||||
page: any = null;
|
||||
|
||||
image$: Promise<string>;
|
||||
|
||||
|
Reference in New Issue
Block a user