+ (onFormValueChanged)="reset()"
+ (onSuccess)="showReport($event)"
+ (onEdit)="onEditReport($event)">
+
diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts
index a2b8e09129..6db510d36d 100644
--- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts
+++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts
@@ -41,12 +41,15 @@ export class AnalyticsComponent implements OnChanges {
@Output()
onSuccess = new EventEmitter();
+ @Output()
+ editReport = new EventEmitter();
+
@Output()
onError = new EventEmitter();
reportParamQuery = new ReportQuery();
- reports: any[];
+ reports: Chart[];
public barChartOptions: any = {
responsive: true,
@@ -107,4 +110,8 @@ export class AnalyticsComponent implements OnChanges {
let clone = JSON.parse(JSON.stringify(report));
report.datasets = clone.datasets;
}
+
+ public onEditReport(name: string) {
+ this.editReport.emit(name);
+ }
}
diff --git a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts
index d9fc0b94cd..f1ccd7c731 100644
--- a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts
+++ b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts
@@ -178,6 +178,13 @@ export class AnalyticsService {
.catch(this.handleError);
}
+ public updateReport(reportId: number, name: string): Observable
{
+ return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.updateReport(reportId, name))
+ .map((res: any) => {
+ console.log('upload');
+ }).catch(this.handleError);
+ }
+
private handleError(error: Response) {
console.error(error);
return Observable.throw(error.json().error || 'Server error');
diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.html b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.html
index 0d94cb0823..97a617011e 100644
--- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.html
+++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-instance-tasks.component.html
@@ -28,7 +28,7 @@
{{ 'DETAILS.TASKS.NO_ACTIVE' | translate }}
-
+
{{ 'DETAILS.LABELS.START_FORM'|translate }}
@@ -78,7 +78,7 @@
-
diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.ts
index 1741867c7c..870320a27b 100644
--- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.ts
+++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.ts
@@ -140,6 +140,7 @@ export class AlfrescoAuthenticationService {
public removeTicket(): void {
this.storage.removeItem('ticket-ECM');
this.storage.removeItem('ticket-BPM');
+ this.alfrescoApi.setTicket(undefined, undefined);
}
/**
diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts
index b8192afe5f..b96f160cba 100644
--- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts
+++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts
@@ -22,9 +22,15 @@ import { AlfrescoContentService } from './AlfrescoContent.service';
import { AlfrescoApiService } from './AlfrescoApi.service';
import { StorageService } from './storage.service';
+declare let jasmine: any;
+
describe('AlfrescoContentService', () => {
- let injector, contentService: AlfrescoContentService, authService: AlfrescoAuthenticationService, node;
+ let injector, contentService: AlfrescoContentService;
+ let authService: AlfrescoAuthenticationService;
+ let settingsService: AlfrescoSettingsService;
+ let storage: StorageService;
+ let node: any;
const nodeId = 'fake-node-id';
@@ -36,29 +42,56 @@ describe('AlfrescoContentService', () => {
AlfrescoSettingsService,
StorageService
]);
- spyOn(localStorage, 'getItem').and.callFake(function (key) {
- return 'myTicket';
- });
- contentService = injector.get(AlfrescoContentService);
authService = injector.get(AlfrescoAuthenticationService);
- authService.login('fake-username', 'fake-password');
+ settingsService = injector.get(AlfrescoSettingsService);
+ contentService = injector.get(AlfrescoContentService);
+ storage = injector.get(StorageService);
+ storage.clear();
node = {
entry: {
id: nodeId
}
};
+
+ jasmine.Ajax.install();
});
- it('should return a valid content URL', () => {
- expect(contentService.getContentUrl(node)).toBe('http://localhost:8080/alfresco/api/' +
- '-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=myTicket');
+ afterEach(() => {
+ jasmine.Ajax.uninstall();
});
- it('should return a valid thumbnail URL', () => {
- expect(contentService.getDocumentThumbnailUrl(node))
- .toBe('http://localhost:8080/alfresco/api/-default-/public/alfresco' +
- '/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=myTicket');
+ beforeEach(() => {
+ settingsService.setProviders('ECM');
+ });
+
+ it('should return a valid content URL', (done) => {
+ authService.login('fake-username', 'fake-password').subscribe(() => {
+ expect(contentService.getContentUrl(node)).toBe('http://localhost:8080/alfresco/api/' +
+ '-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=fake-post-ticket');
+ done();
+ });
+
+ jasmine.Ajax.requests.mostRecent().respondWith({
+ 'status': 201,
+ contentType: 'application/json',
+ responseText: JSON.stringify({'entry': {'id': 'fake-post-ticket', 'userId': 'admin'}})
+ });
+ });
+
+ it('should return a valid thumbnail URL', (done) => {
+ authService.login('fake-username', 'fake-password').subscribe(() => {
+ expect(contentService.getDocumentThumbnailUrl(node))
+ .toBe('http://localhost:8080/alfresco/api/-default-/public/alfresco' +
+ '/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=fake-post-ticket');
+ done();
+ });
+
+ jasmine.Ajax.requests.mostRecent().respondWith({
+ 'status': 201,
+ contentType: 'application/json',
+ responseText: JSON.stringify({'entry': {'id': 'fake-post-ticket', 'userId': 'admin'}})
+ });
});
});
diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.html b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.html
index 6a4d76d5a7..ce360fdc6f 100644
--- a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.html
+++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.html
@@ -23,13 +23,14 @@
class="mdl-textfield__input"
id="name"
required
- value="Untitled folder"
+ [(ngModel)]="folderName"
+ placeholder="Folder name"
data-automation-id="name"
autocapitalize="none" #name/>
\ No newline at end of file
diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.ts
index 848d59a10e..40eca916b9 100644
--- a/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.ts
+++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-menu-action.ts
@@ -55,6 +55,8 @@ export class DocumentMenuAction implements OnInit {
message: string;
+ folderName: string = '';
+
constructor(
private documentListService: DocumentListService,
private translate: AlfrescoTranslationService) {
@@ -72,7 +74,7 @@ export class DocumentMenuAction implements OnInit {
.subscribe(
res => {
let relativeDir = this.currentFolderPath;
- console.log(relativeDir);
+ this.folderName = '';
this.success.emit({value: relativeDir});
},
error => {
@@ -128,4 +130,8 @@ export class DocumentMenuAction implements OnInit {
}
return message;
}
+
+ isFolderNameEmpty() {
+ return this.folderName === '' ? true : false;
+ }
}