[ADF-2650] Error with rootDir at insights folder fixed (#3215)

* [ADF-1939] Responsive button to edit reports

* [ADF-1939] Removed unused dependencies in material module

* [ADF-1939] Edit buttons now use flex layout

* [ADF-2650] Report action menu component created

* [ADF-2650] Added Button Model

* [ADF-2650] Buttons component finished

* [ADF-2650] Buttons menu component moved to core library

* [ADF-2650] Included index.ts in core/buttons-menu

* [ADF-2650] cleaned the module and public api file

* Revert "[ADF-2650] Included index.ts in core/buttons-menu"

This reverts commit 6bdf1f2f48a30bb4622eb4c000e5318370503710.

* [ADF-2650] Applied the peer review changes

* [ADF-2650] Comment removed

* [ADF-2650] Failing tests fixed

* [ADF-2650] Dynamic theming for analytic reports

* [ADF-2650] Themes not ap
This commit is contained in:
davidcanonieto
2018-04-26 14:56:05 +01:00
committed by Eugenio Romano
parent 2c0e7aa035
commit b2b3625929
21 changed files with 604 additions and 174 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ContentService, LogService } from '@alfresco/adf-core';
import { ContentService, LogService, MenuButton } from '@alfresco/adf-core';
import {
AfterContentChecked,
Component,
@@ -38,6 +38,8 @@ import { ReportParametersModel } from '../../diagram/models/report/reportParamet
import { ReportQuery } from '../../diagram/models/report/reportQuery.model';
import { AnalyticsService } from '../services/analytics.service';
// @deprecated 2.3.0 analytics-report-parameters tag removed
@Component({
selector: 'adf-analytics-report-parameters, analytics-report-parameters',
@@ -95,6 +97,8 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
reportName: string;
buttons: MenuButton[] = [];
private dropDownSub;
private reportParamsSub;
private paramOpts;
@@ -107,6 +111,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
private logService: LogService,
private contentService: ContentService,
private dialog: MatDialog) {
}
ngOnInit() {
@@ -130,9 +135,12 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
if (this.reportForm) {
this.reportForm.reset();
}
let reportId = changes['reportId'];
if (reportId && reportId.currentValue) {
this.reportId = reportId.currentValue;
this.getReportParams(reportId.currentValue);
this.setButtons();
}
let appId = changes['appId'];
@@ -145,7 +153,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
let formBuilderGroup: any = {};
parameters.forEach((param: ReportParameterDetailsModel) => {
switch (param.type) {
case 'dateRange' :
case 'dateRange':
formBuilderGroup.dateRange = new FormGroup({}, Validators.required);
break;
case 'processDefinition':
@@ -348,10 +356,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
return this.action === 'Save';
}
isFormValid() {
return this.reportForm && this.reportForm.dirty && this.reportForm.valid;
}
doExport(paramQuery: ReportQuery) {
this.analyticsService.exportReportToCsv(this.reportId, paramQuery).subscribe(
(data: any) => {
@@ -385,4 +389,38 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
isParametersHide() {
return this.hideParameters;
}
isFormValid() {
return this.reportForm && this.reportForm.dirty && this.reportForm.valid;
}
setButtons() {
this.buttons = [
new MenuButton({
label: 'ANALYTICS.MESSAGES.ICON-SETTING',
icon: 'settings',
handler: this.toggleParameters.bind(this)
}),
new MenuButton({
label: 'ANALYTICS.MESSAGES.ICON-DELETE',
icon: 'delete',
handler: this.deleteReport.bind(this, this.reportId),
id: 'delete-button'
}),
new MenuButton({
label: 'ANALYTICS.MESSAGES.ICON-EXPORT-CSV',
icon: 'file_download',
handler: this.showDialog.bind(this, 'Export'),
id: 'export-button',
isVisible: this.isFormValid.bind(this)
}),
new MenuButton({
label: 'ANALYTICS.MESSAGES.ICON-SAVE',
icon: 'save',
handler: this.showDialog.bind(this, 'Save'),
id: 'save-button',
isVisible: this.isFormValid.bind(this)
})
];
}
}