mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3299] and [ADF-3300] upgrade to Angular and Material 6 (#3579)
* upgrade to HttpClient * upgrade to Renderer2 * upgrade Document reference * remove useless test with deprecated ReflectiveInjector * upgrade to latest typescript * upgrade libs * upgrade package scripts * remove rxjs blacklists and duplicate rules * add rxjs compat to help with migration * fix breaking changes * fix breaking changes in material * fix breaking changes (material 6) * upgrade rxjs, ngx-translate and flex layout * update unit tests * restore providers * upgrade deprecated Observable.error * rebase fix first configuration problems * fix style issues commented * fix core build * fix lib template errors * move lib test execution in angular.json * ignore * karma conf files * fix import statement test * single run option * update packages reporter * restore report * increase timeout * improve karma conf test configuration * fix test issues about lint * fix test analytics * fix process service test * content service fix test * fix logout directive test * fix core test * fix build * update node-sass to latest * update angular cli dependencies * improve build script create directorites and move files only if previous command succeded * upgrade individual libs to 6.0 * remove old webpack files * revert sass change * fix type issues fix style issues * fix tslint demo shell issue * fix peerdependencies * fix test e2e BC * package upate * fix style import issue * extract-text-webpack-plugin beta * fix test dist build command * remove alpha js-api * fix tslint issue add banner tslint rule * upload service fix * change BC script * fix test dist script * increase demo shell timeout test * verbose copy * path absolute * fix script bc * fix copy part * fix path warning fix monaco editor * remove duplicate header * remove unused import * fix align and check ago tests * add missing import * fix notification button selector * [ANGULAR6] fixed core tests * fix CS test * fix cs test step 2 * increase travis_wait for dist * fix attachment PS * fix checklist test * use pdf min
This commit is contained in:
committed by
Eugenio Romano
parent
c510ec864d
commit
6b24bfb1d4
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
|
||||
import { AnalyticsService } from '../services/analytics.service';
|
||||
import { share } from 'rxjs/operators';
|
||||
|
||||
// @deprecated 2.3.0 analytics-report-list tag removed
|
||||
@Component({
|
||||
@@ -59,7 +59,8 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
reports: ReportParametersModel[] = [];
|
||||
|
||||
constructor(private analyticsService: AnalyticsService) {
|
||||
this.report$ = new Observable<ReportParametersModel>(observer => this.reportObserver = observer).share();
|
||||
this.report$ = new Observable<ReportParametersModel>(observer => this.reportObserver = observer)
|
||||
.pipe(share());
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -15,8 +15,8 @@
|
||||
data-automation-id="reportName"
|
||||
[value]="reportParameters.name"
|
||||
(input)="reportParameters.name=$event.target.value"
|
||||
(blur)="editTitle($event)"
|
||||
(keyup.enter)="editTitle($event)"
|
||||
(blur)="editTitle()"
|
||||
(keyup.enter)="editTitle()"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@@ -24,7 +24,7 @@
|
||||
<mat-icon class="adf-report-icon" >mode_edit</mat-icon>
|
||||
<h4>{{reportParameters.name}}</h4>
|
||||
</div>
|
||||
</adf-toolbar-title>
|
||||
</adf-toolbar-title>
|
||||
<adf-buttons-action-menu *ngIf="!isEditable">
|
||||
<button mat-menu-item (click)="toggleParameters()" id="">
|
||||
<mat-icon>settings</mat-icon><span>{{ 'ANALYTICS.MESSAGES.ICON-SETTING' | translate }}</span>
|
||||
@@ -40,7 +40,7 @@
|
||||
<mat-icon>save</mat-icon><span>{{ 'ANALYTICS.MESSAGES.ICON-SAVE' | translate }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</adf-buttons-action-menu>
|
||||
</adf-buttons-action-menu>
|
||||
</adf-toolbar>
|
||||
<div *ngFor="let field of reportParameters.definition.parameters"
|
||||
[class.is-hide]="isParametersHide()">
|
||||
@@ -132,4 +132,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -23,7 +23,7 @@ import { AnalyticsReportParametersComponent } from '../components/analytics-repo
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||
import { AnalyticsService } from '../services/analytics.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -448,7 +448,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
}));
|
||||
|
||||
it('Should be able to change the report title', (done) => {
|
||||
spyOn(service, 'updateReport').and.returnValue(Observable.of(analyticParamsMock.reportDefParamStatus));
|
||||
spyOn(service, 'updateReport').and.returnValue(of(analyticParamsMock.reportDefParamStatus));
|
||||
|
||||
let title: HTMLElement = element.querySelector('h4');
|
||||
title.click();
|
||||
|
@@ -98,7 +98,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
private dropDownSub;
|
||||
private reportParamsSub;
|
||||
private paramOpts;
|
||||
private reportParamQuery: ReportQuery;
|
||||
reportParamQuery: ReportQuery;
|
||||
private hideParameters: boolean = true;
|
||||
formValidState: boolean = false;
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Response } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { ParameterValueModel } from '../../diagram/models/report/parameterValue.model';
|
||||
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
|
||||
import { BarChart } from '../../diagram/models/chart/barChart.model';
|
||||
@@ -28,8 +28,7 @@ import { HeatMapChart } from '../../diagram/models/chart/heatMapChart.model';
|
||||
import { MultiBarChart } from '../../diagram/models/chart/multiBarChart.model';
|
||||
import { PieChart } from '../../diagram/models/chart/pieChart.model';
|
||||
import { TableChart } from '../../diagram/models/chart/tableChart.model';
|
||||
|
||||
import 'rxjs/add/observable/throw';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class AnalyticsService {
|
||||
@@ -39,31 +38,37 @@ export class AnalyticsService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive all the Deployed app
|
||||
* Retrieve all the Deployed app
|
||||
*/
|
||||
getReportList(appId: number): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportList())
|
||||
.map((res: any) => {
|
||||
let reports: ReportParametersModel[] = [];
|
||||
res.forEach((report: ReportParametersModel) => {
|
||||
let reportModel = new ReportParametersModel(report);
|
||||
if (this.isReportValid(appId, report)) {
|
||||
reports.push(reportModel);
|
||||
}
|
||||
});
|
||||
return reports;
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getReportList())
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
let reports: ReportParametersModel[] = [];
|
||||
res.forEach((report: ReportParametersModel) => {
|
||||
let reportModel = new ReportParametersModel(report);
|
||||
if (this.isReportValid(appId, report)) {
|
||||
reports.push(reportModel);
|
||||
}
|
||||
});
|
||||
return reports;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive Report by name
|
||||
* Retrieve Report by name
|
||||
* @param reportName - string - The name of report
|
||||
*/
|
||||
getReportByName(reportName: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportList())
|
||||
.map((response: any) => {
|
||||
return response.find(report => report.name === reportName);
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getReportList())
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
return response.find(report => report.name === reportName);
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
private isReportValid(appId: number, report: ReportParametersModel) {
|
||||
@@ -75,10 +80,13 @@ export class AnalyticsService {
|
||||
}
|
||||
|
||||
getReportParams(reportId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportParams(reportId))
|
||||
.map((res: any) => {
|
||||
return new ReportParametersModel(res);
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getReportParams(reportId))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
return new ReportParametersModel(res);
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
getParamValuesByType(type: string, appId: number, reportId?: string, processDefinitionId?: string) {
|
||||
@@ -144,101 +152,125 @@ export class AnalyticsService {
|
||||
}
|
||||
|
||||
getProcessDefinitionsValuesNoApp(): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getProcessDefinitions())
|
||||
.map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel(opt));
|
||||
});
|
||||
return paramOptions;
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getProcessDefinitions())
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel(opt));
|
||||
});
|
||||
return paramOptions;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
getProcessDefinitionsValues(appId: number): Observable<any> {
|
||||
let options = { 'appDefinitionId': appId };
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.processDefinitionsApi.getProcessDefinitions(options))
|
||||
.map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.data.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel(opt));
|
||||
});
|
||||
return paramOptions;
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.processDefinitionsApi.getProcessDefinitions(options))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.data.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel(opt));
|
||||
});
|
||||
return paramOptions;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
getTasksByProcessDefinitionId(reportId: string, processDefinitionId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId))
|
||||
.map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel({ id: opt, name: opt }));
|
||||
});
|
||||
return paramOptions;
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel({ id: opt, name: opt }));
|
||||
});
|
||||
return paramOptions;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
getReportsByParams(reportId: number, paramsQuery: any): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportsByParams(reportId, paramsQuery))
|
||||
.map((res: any) => {
|
||||
let elements: Chart[] = [];
|
||||
res.elements.forEach((chartData) => {
|
||||
if (chartData.type === 'pieChart') {
|
||||
elements.push(new PieChart(chartData));
|
||||
} else if (chartData.type === 'table') {
|
||||
elements.push(new TableChart(chartData));
|
||||
} else if (chartData.type === 'processDefinitionHeatMap') {
|
||||
elements.push(new HeatMapChart(chartData));
|
||||
} else if (chartData.type === 'masterDetailTable') {
|
||||
elements.push(new DetailsTableChart(chartData));
|
||||
} else if (chartData.type === 'barChart') {
|
||||
elements.push(new BarChart(chartData));
|
||||
} else if (chartData.type === 'multiBarChart') {
|
||||
elements.push(new MultiBarChart(chartData));
|
||||
}
|
||||
});
|
||||
return from(this.apiService.getInstance().activiti.reportApi.getReportsByParams(reportId, paramsQuery))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
let elements: Chart[] = [];
|
||||
res.elements.forEach((chartData) => {
|
||||
if (chartData.type === 'pieChart') {
|
||||
elements.push(new PieChart(chartData));
|
||||
} else if (chartData.type === 'table') {
|
||||
elements.push(new TableChart(chartData));
|
||||
} else if (chartData.type === 'processDefinitionHeatMap') {
|
||||
elements.push(new HeatMapChart(chartData));
|
||||
} else if (chartData.type === 'masterDetailTable') {
|
||||
elements.push(new DetailsTableChart(chartData));
|
||||
} else if (chartData.type === 'barChart') {
|
||||
elements.push(new BarChart(chartData));
|
||||
} else if (chartData.type === 'multiBarChart') {
|
||||
elements.push(new MultiBarChart(chartData));
|
||||
}
|
||||
});
|
||||
|
||||
return elements;
|
||||
}).catch(err => this.handleError(err));
|
||||
return elements;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
createDefaultReports(): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.createDefaultReports())
|
||||
.map(this.toJson)
|
||||
.catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.createDefaultReports())
|
||||
.pipe(
|
||||
map(this.toJson),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
updateReport(reportId: number, name: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.updateReport(reportId, name))
|
||||
.map((res: any) => {
|
||||
this.logService.info('upload');
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.updateReport(reportId, name))
|
||||
.pipe(
|
||||
map(() => this.logService.info('upload')),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
exportReportToCsv(reportId: string, paramsQuery: any): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.exportToCsv(reportId, paramsQuery))
|
||||
.map((res: any) => {
|
||||
this.logService.info('export');
|
||||
return res;
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.exportToCsv(reportId, paramsQuery))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
this.logService.info('export');
|
||||
return res;
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
saveReport(reportId: string, paramsQuery: any): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.saveReport(reportId, paramsQuery))
|
||||
.map(() => {
|
||||
this.logService.info('save');
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.saveReport(reportId, paramsQuery))
|
||||
.pipe(
|
||||
map(() => {
|
||||
this.logService.info('save');
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
deleteReport(reportId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.deleteReport(reportId))
|
||||
.map(() => {
|
||||
this.logService.info('delete');
|
||||
}).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.reportApi.deleteReport(reportId))
|
||||
.pipe(
|
||||
map(() => {
|
||||
this.logService.info('delete');
|
||||
}),
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
private handleError(error: Response) {
|
||||
this.logService.error(error);
|
||||
return Observable.throw(error || 'Server error');
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
|
||||
toJson(res: any) {
|
||||
|
@@ -77,7 +77,7 @@ describe('DiagramTooltipComponent', () => {
|
||||
let nameProperty = fixture.debugElement.query(By.css('.adf-diagram-name-property'));
|
||||
|
||||
expect(nameProperty).not.toBeNull();
|
||||
expect(nameProperty.nativeElement.innerText).toBe('Name: diagram-element-name');
|
||||
expect(nameProperty.nativeElement.innerText).toBe('Name:diagram-element-name');
|
||||
});
|
||||
|
||||
it('should NOT render the name if name is NOT defined in the tooltip body', () => {
|
||||
|
@@ -17,8 +17,8 @@
|
||||
|
||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/throw';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class DiagramsService {
|
||||
@@ -28,17 +28,21 @@ export class DiagramsService {
|
||||
}
|
||||
|
||||
getProcessDefinitionModel(processDefinitionId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().
|
||||
activiti.modelJsonBpmnApi.getModelJSON(processDefinitionId)).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.modelJsonBpmnApi.getModelJSON(processDefinitionId))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
getRunningProcessDefinitionModel(processInstanceId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().
|
||||
activiti.modelJsonBpmnApi.getModelJSONForProcessDefinition(processInstanceId)).catch(err => this.handleError(err));
|
||||
return from(this.apiService.getInstance().activiti.modelJsonBpmnApi.getModelJSONForProcessDefinition(processInstanceId))
|
||||
.pipe(
|
||||
catchError(err => this.handleError(err))
|
||||
);
|
||||
}
|
||||
|
||||
private handleError(error: any) {
|
||||
this.logService.error(error);
|
||||
return Observable.throw(error || 'Server error');
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
}
|
||||
|
@@ -1,25 +0,0 @@
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
require('core-js/es6');
|
||||
require('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');
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
|
||||
|
||||
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');
|
||||
|
||||
TestBed.initTestEnvironment(
|
||||
browser.BrowserDynamicTestingModule,
|
||||
browser.platformBrowserDynamicTesting()
|
||||
);
|
101
lib/insights/karma.conf.js
Normal file
101
lib/insights/karma.conf.js
Normal file
@@ -0,0 +1,101 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
|
||||
files: [
|
||||
{pattern: '../../node_modules/core-js/client/core.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/tslib/tslib.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/hammerjs/hammer.min.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/hammerjs/hammer.min.js.map', included: false, watched: false},
|
||||
|
||||
// pdf-js
|
||||
{pattern: '../../node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false},
|
||||
|
||||
{
|
||||
pattern: '../../node_modules/@angular/material/prebuilt-themes/indigo-pink.css',
|
||||
included: true,
|
||||
watched: false
|
||||
},
|
||||
|
||||
{pattern: '../../node_modules/chart.js/dist/Chart.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/raphael/raphael.min.js', included: true, watched: false},
|
||||
{
|
||||
pattern: './node_modules/ng2-charts/bundles/ng2-charts.umd.js',
|
||||
included: false,
|
||||
served: true,
|
||||
watched: false
|
||||
},
|
||||
|
||||
{pattern: '../../node_modules/alfresco-js-api/dist/alfresco-js-api.min.js', included: true, watched: false},
|
||||
{pattern: '../../node_modules/moment/min/moment.min.js', included: true, watched: false},
|
||||
|
||||
{pattern: './i18n/**/en.json', included: false, served: true, watched: false},
|
||||
|
||||
{pattern: './**/*.ts', included: false, served: true, watched: false},
|
||||
|
||||
{pattern: './app.config.json', included: false, served: true, watched: false},
|
||||
],
|
||||
|
||||
frameworks: ['jasmine-ajax', 'jasmine', '@angular-devkit/build-angular'],
|
||||
|
||||
proxies: {
|
||||
'/base/assets/' :'/base/assets/',
|
||||
'/assets/adf-insights/i18n/en.json': '/base/i18n/en.json',
|
||||
'/app.config.json': '/base/app.config.json'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
require('karma-jasmine-ajax'),
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma'),
|
||||
require('karma-mocha-reporter')
|
||||
],
|
||||
client: {
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: './lib/coverage/insights/',
|
||||
reports: ['html', 'lcovonly'],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_DEBUG,
|
||||
|
||||
colors: true,
|
||||
|
||||
autoWatch: false,
|
||||
|
||||
browserDisconnectTimeout: 200000,
|
||||
browserNoActivityTimeout: 2400000,
|
||||
captureTimeout: 1200000,
|
||||
|
||||
customLaunchers: {
|
||||
ChromeHeadless: {
|
||||
base: 'Chrome',
|
||||
flags: [
|
||||
'--no-sandbox',
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--remote-debugging-port=9222'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
reporters: ['mocha', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
@@ -17,11 +17,12 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import {
|
||||
MAT_PLACEHOLDER_GLOBAL_OPTIONS, MatAutocompleteModule, MatButtonModule, MatCardModule, MatCheckboxModule,
|
||||
MatAutocompleteModule, MatButtonModule, MatCardModule, MatCheckboxModule,
|
||||
MatChipsModule, MatDatepickerModule, MatDialogModule, MatGridListModule, MatIconModule,
|
||||
MatInputModule, MatListModule, MatNativeDateModule, MatOptionModule, MatProgressSpinnerModule, MatRadioModule,
|
||||
MatRippleModule, MatSelectModule, MatSlideToggleModule, MatTableModule, MatTabsModule,
|
||||
MatTooltipModule, MatMenuModule
|
||||
MatTooltipModule, MatMenuModule,
|
||||
MAT_LABEL_GLOBAL_OPTIONS
|
||||
} from '@angular/material';
|
||||
|
||||
export function modules() {
|
||||
@@ -35,10 +36,10 @@ export function modules() {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
providers: [
|
||||
{provide: MAT_PLACEHOLDER_GLOBAL_OPTIONS, useValue: { float: 'never' }}
|
||||
],
|
||||
imports: modules(),
|
||||
exports: modules()
|
||||
exports: modules(),
|
||||
providers: [
|
||||
{ provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'never' }}
|
||||
]
|
||||
})
|
||||
export class MaterialModule {}
|
||||
|
@@ -1,12 +1,10 @@
|
||||
{
|
||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||
"whitelistedNonPeerDependencies": [ "." ],
|
||||
"workingDirectory" : "./ng_work",
|
||||
"src": "../insights/",
|
||||
"dest": "../dist/insights/",
|
||||
"lib": {
|
||||
"languageLevel": [ "dom", "es2016" ],
|
||||
"licensePath": "../config/assets/license_header_add.txt",
|
||||
"comments" : "none",
|
||||
"entryFile": "./public-api.ts",
|
||||
"flatModuleFile": "adf-insights",
|
||||
|
@@ -11,37 +11,33 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "5.1.1",
|
||||
"@angular/cdk": "5.0.1",
|
||||
"@angular/common": "5.1.1",
|
||||
"@angular/compiler": "5.1.1",
|
||||
"@angular/core": "5.1.1",
|
||||
"@angular/flex-layout": "2.0.0-beta.12",
|
||||
"@angular/forms": "5.1.1",
|
||||
"@angular/http": "5.1.1",
|
||||
"@angular/material": "5.0.1",
|
||||
"@angular/material-moment-adapter": "5.0.1",
|
||||
"@angular/platform-browser": "5.1.1",
|
||||
"@angular/platform-browser-dynamic": "5.1.1",
|
||||
"@angular/router": "5.1.1",
|
||||
"@ngx-translate/core": "9.1.1",
|
||||
"peerDependencies": {
|
||||
"@angular/animations": ">=5.1.1",
|
||||
"@angular/cdk": ">=5.1.1",
|
||||
"@angular/common": ">=5.1.1",
|
||||
"@angular/compiler": ">=5.1.1",
|
||||
"@angular/core": ">=5.1.1",
|
||||
"@angular/flex-layout": ">=5.1.1",
|
||||
"@angular/forms": ">=5.1.1",
|
||||
"@angular/http": ">=5.1.1",
|
||||
"@angular/material": ">=5.1.1",
|
||||
"@angular/material-moment-adapter": ">=5.1.1",
|
||||
"@angular/platform-browser": ">=5.1.1",
|
||||
"@angular/platform-browser-dynamic": ">=5.1.1",
|
||||
"@angular/router": ">=5.1.1",
|
||||
"alfresco-js-api": "2.5.0-beta2",
|
||||
"rxjs": ">=6.2.2",
|
||||
"@alfresco/adf-core": "2.5.0-beta2",
|
||||
"@alfresco/adf-content-services": "2.5.0-beta2",
|
||||
"@ngx-translate/core": "^10.0.2",
|
||||
"chart.js": "2.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"minimatch": "3.0.4",
|
||||
"moment": "2.20.1",
|
||||
"moment": "^2.22.2",
|
||||
"ng2-charts": "1.6.0",
|
||||
"pdfjs-dist": "1.5.404",
|
||||
"raphael": "2.2.7",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.5.2",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.8.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"keywords": [
|
||||
"analytics",
|
||||
|
41
lib/insights/test.ts
Normal file
41
lib/insights/test.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import 'core-js/es7/reflect';
|
||||
import 'zone.js/dist/zone';
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
import pdfjsLib = require('pdfjs-dist');
|
||||
|
||||
declare const require: any;
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting()
|
||||
);
|
||||
|
||||
pdfjsLib.PDFJS.workerSrc = 'node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
|
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
Reference in New Issue
Block a user