diff --git a/demo-shell-ng2/app/components/about/about.component.html b/demo-shell-ng2/app/components/about/about.component.html index 132925dfc1..ac9815a75f 100644 --- a/demo-shell-ng2/app/components/about/about.component.html +++ b/demo-shell-ng2/app/components/about/about.component.html @@ -16,20 +16,7 @@

BPM

{{ bpmVersion.edition }}

- - - - - - - - - - - - - -
Major VersionRevision VersionMinor VersionType
{{ bpmVersion.majorVersion }}{{ bpmVersion.revisionVersion }}{{ bpmVersion.minorVersion }}{{ bpmVersion.type }}
+ {{ bpmVersion.majorVersion }}.{{ bpmVersion.minorVersion }}.{{ bpmVersion.revisionVersion }}

ECM

@@ -38,64 +25,14 @@ {{ ecmVersion.version.display }}

License

- - - - - - - - - - - - - - - - - - - -
Issued At Expires At Remaining Days Holder Mode Is Cluster Enabled Is Cryptodoc Enable
{{ ecmVersion.license.issuedAt }}{{ ecmVersion.license.expiresAt }}{{ ecmVersion.license.remainingDays }}{{ ecmVersion.license.holder }}{{ ecmVersion.license.mode }}{{ ecmVersion.license.isClusterEnabled }}{{ ecmVersion.license.isCryptodocEnabled }}
+ +

Status

- - - - - - - - - - - - - -
ReadOnly Is Audit Enable Is quick shared enable Thumbnail Generation
{{ ecmVersion.status.isReadOnly }}{{ ecmVersion.status.isAuditEnabled }}{{ ecmVersion.status.isQuickShareEnabled }}{{ ecmVersion.status.isThumbnailGenerationEnabled }}
+ +

Modules

- - - - - - - - - - - - - - - - - - - - - -
ID Title Description Version Install Date Install State Version Minor Version Max
{{ module.id }}{{ module.title }}{{ module.description }}{{ module.version }}{{ module.installDate }}{{ module.installState }}{{ module.versionMin }}{{ module.versionMax }}
+ +
diff --git a/demo-shell-ng2/app/components/about/about.component.ts b/demo-shell-ng2/app/components/about/about.component.ts index e62061e748..a57700faa3 100644 --- a/demo-shell-ng2/app/components/about/about.component.ts +++ b/demo-shell-ng2/app/components/about/about.component.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { DataSource } from '@angular/cdk/collections'; import { Component, OnInit } from '@angular/core'; import { Http } from '@angular/http'; import { AlfrescoAuthenticationService, AppConfigService, BpmProductVersionModel, DiscoveryApiService, EcmProductVersionModel } from 'ng2-alfresco-core'; @@ -28,6 +29,9 @@ import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable'; export class AboutComponent implements OnInit { data: ObjectDataTableAdapter; + status: ObjectDataTableAdapter; + license: ObjectDataTableAdapter; + modules: ObjectDataTableAdapter; githubUrlCommitAlpha: string = 'https://github.com/Alfresco/alfresco-ng2-components/commits/'; configFile: string = 'app.config.json'; @@ -48,6 +52,33 @@ export class AboutComponent implements OnInit { if (this.authService.isEcmLoggedIn()) { this.discovery.getEcmProductInfo().subscribe((ecmVers) => { this.ecmVersion = ecmVers; + + this.modules = new ObjectDataTableAdapter(this.ecmVersion.modules, [ + {type: 'text', key: 'id', title: 'ID', sortable: true}, + {type: 'text', key: 'title', title: 'Title', sortable: true}, + {type: 'text', key: 'version', title: 'Description', sortable: true}, + {type: 'text', key: 'installDate', title: 'Install Date', sortable: true}, + {type: 'text', key: 'installState', title: 'Install State', sortable: true}, + {type: 'text', key: 'versionMin', title: 'Version Minor', sortable: true}, + {type: 'text', key: 'versionMax', title: 'Version Max', sortable: true} + ]); + + this.status = new ObjectDataTableAdapter([this.ecmVersion.status], [ + {type: 'text', key: 'isReadOnly', title: 'ReadOnly', sortable: true}, + {type: 'text', key: 'isAuditEnabled', title: 'Is Audit Enable', sortable: true}, + {type: 'text', key: 'isQuickShareEnabled', title: 'Is quick shared enable', sortable: true}, + {type: 'text', key: 'isThumbnailGenerationEnabled', title: 'Thumbnail Generation', sortable: true} + ]); + + this.license = new ObjectDataTableAdapter([this.ecmVersion.license], [ + {type: 'text', key: 'issuedAt', title: 'Issued At', sortable: true}, + {type: 'text', key: 'expiresAt', title: 'Expires At', sortable: true}, + {type: 'text', key: 'remainingDays', title: 'Remaining Days', sortable: true}, + {type: 'text', key: 'holder', title: 'Holder', sortable: true}, + {type: 'text', key: 'mode', title: 'Is Cluster Enabled', sortable: true}, + {type: 'text', key: 'isClusterEnabled', title: 'Is Cluster Enabled', sortable: true}, + {type: 'text', key: 'isCryptodocEnabled', title: 'Is Cryptodoc Enable', sortable: true} + ]); }); } @@ -78,6 +109,7 @@ export class AboutComponent implements OnInit { {type: 'text', key: 'name', title: 'Name', sortable: true}, {type: 'text', key: 'version', title: 'Version', sortable: true} ]); + }); this.ecmHost = this.appConfig.get('ecmHost'); diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html index 9b82f8ba8f..b91c008e98 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html @@ -158,7 +158,7 @@
- {{'PS-TAB.START-PROCESS' | translate}} + {{'PS-TAB.AUDIT-LOG' | translate}}
+
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.spec.ts index 890d382b15..518b8cf692 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.spec.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.spec.ts @@ -73,10 +73,10 @@ describe('TaskDetailsComponent', () => { providers: [ TaskListService, PeopleProcessService, - { provide: TranslationService, useClass: TranslationMock }, - { provide: AppConfigService, useClass: AppConfigServiceMock } + {provide: TranslationService, useClass: TranslationMock}, + {provide: AppConfigService, useClass: AppConfigServiceMock} ], - schemas: [ NO_ERRORS_SCHEMA ] + schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); logService = TestBed.get(LogService); @@ -157,7 +157,7 @@ describe('TaskDetailsComponent', () => { })); it('should fetch new task details when taskId changed', () => { - component.ngOnChanges({ 'taskId': change }); + component.ngOnChanges({'taskId': change}); expect(getTaskDetailsSpy).toHaveBeenCalledWith('456'); }); @@ -167,12 +167,12 @@ describe('TaskDetailsComponent', () => { }); it('should NOT fetch new task details when taskId changed to null', () => { - component.ngOnChanges({ 'taskId': nullChange }); + component.ngOnChanges({'taskId': nullChange}); expect(getTaskDetailsSpy).not.toHaveBeenCalled(); }); it('should set a placeholder message when taskId changed to null', () => { - component.ngOnChanges({ 'taskId': nullChange }); + component.ngOnChanges({'taskId': nullChange}); fixture.detectChanges(); expect(fixture.nativeElement.innerText).toBe('TASK_DETAILS.MESSAGES.NONE'); }); @@ -285,6 +285,48 @@ describe('TaskDetailsComponent', () => { }); + describe('Comments', () => { + + it('should comments NOT be readonly if is there are user involved', () => { + component.showComments = true; + component.showHeaderContent = true; + component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)}); + component.taskPeople = [fakeUser]; + + fixture.detectChanges(); + expect((component.activiticomments as any).nativeElement.readOnly).toBe(false); + }); + + it('should comments be readonly if is there are no user involved', () => { + component.showComments = true; + component.showHeaderContent = true; + component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)}); + component.taskPeople = []; + + fixture.detectChanges(); + expect((component.activiticomments as any).nativeElement.readOnly).toBe(true); + }); + + it('should comments be present if showComments is true', () => { + component.showComments = true; + component.showHeaderContent = true; + component.taskPeople = []; + component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)}); + + fixture.detectChanges(); + expect(component.activiticomments).toBeDefined(); + }); + + it('should comments NOT be present if showComments is false', () => { + component.showComments = false; + component.taskPeople = []; + component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)}); + + fixture.detectChanges(); + expect(component.activiticomments).not.toBeDefined(); + }); + }); + describe('assign task to user', () => { beforeEach(() => { diff --git a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.ts index 78f1a1735e..1c6247c591 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/task-details.component.ts @@ -28,12 +28,12 @@ import { Component, import { MdDialog, MdDialogRef } from '@angular/material'; import { ContentLinkModel, FormFieldValidator, FormModel, FormOutcomeEvent } from 'ng2-activiti-form'; import { AlfrescoAuthenticationService, CardViewUpdateService, ClickNotification, LogService, UpdateNotification } from 'ng2-alfresco-core'; -import { LightUserRepresentation } from 'ng2-alfresco-core'; -import { PeopleProcessService } from 'ng2-alfresco-core'; +import { LightUserRepresentation, PeopleProcessService } from 'ng2-alfresco-core'; import { Observable, Observer } from 'rxjs/Rx'; import { TaskQueryRequestRepresentationModel } from '../models/filter.model'; import { TaskDetailsModel } from '../models/task-details.model'; import { TaskListService } from './../services/tasklist.service'; +import { CommentsComponent } from './comments.component'; declare var require: any; @@ -48,7 +48,7 @@ declare var require: any; export class TaskDetailsComponent implements OnInit, OnChanges { @ViewChild('activiticomments') - activiticomments: any; + activiticomments: CommentsComponent; @ViewChild('activitichecklist') activitichecklist: any;