+
+
diff --git a/docs/process-services/process-list.component.md b/docs/process-services/process-list.component.md
index cc907366ed..2f5218b276 100644
--- a/docs/process-services/process-list.component.md
+++ b/docs/process-services/process-list.component.md
@@ -139,7 +139,7 @@ information defined in `app.config.json` as in the example below:
-
{{getFullName(entry.row.obj.assignee)}}
+
{{entry.row.obj.assignee | fullName}}
diff --git a/docs/process-services/task-list.component.md b/docs/process-services/task-list.component.md
index 6ff3e61b42..ee5eb81a50 100644
--- a/docs/process-services/task-list.component.md
+++ b/docs/process-services/task-list.component.md
@@ -162,7 +162,7 @@ You can use an HTML-based schema and an `app.config.json` custom schema declarat
-
{{getFullName(entry.row.obj.assignee)}}
+
{{entry.row.obj.assignee | fullName}}
diff --git a/lib/core/pipes/full-name.pipe.spec.ts b/lib/core/pipes/full-name.pipe.spec.ts
new file mode 100644
index 0000000000..b6ed581f4b
--- /dev/null
+++ b/lib/core/pipes/full-name.pipe.spec.ts
@@ -0,0 +1,48 @@
+/*!
+ * @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 { FullNamePipe } from './full-name.pipe';
+import { async } from '@angular/core/testing';
+
+describe('FullNamePipe', () => {
+
+ let pipe: FullNamePipe;
+
+ beforeEach(async(() => {
+ pipe = new FullNamePipe();
+ }));
+
+ it('should return empty string when there is no name', () => {
+ const user = {};
+ expect(pipe.transform(user)).toBe('');
+ });
+
+ it('should return only firstName as fullName when there is no lastName ', () => {
+ const user = {firstName : 'Abc'};
+ expect(pipe.transform(user)).toBe('Abc');
+ });
+
+ it('should return only lastName as fullName when there is no firstName ', () => {
+ const user = {lastName : 'Xyz'};
+ expect(pipe.transform(user)).toBe('Xyz');
+ });
+
+ it('should return fullName when firstName and lastName are available', () => {
+ const user = {firstName : 'Abc', lastName : 'Xyz'};
+ expect(pipe.transform(user)).toBe('Abc Xyz');
+ });
+});
diff --git a/lib/core/pipes/full-name.pipe.ts b/lib/core/pipes/full-name.pipe.ts
new file mode 100644
index 0000000000..10e27a499a
--- /dev/null
+++ b/lib/core/pipes/full-name.pipe.ts
@@ -0,0 +1,35 @@
+/*!
+ * @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 { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({ name: 'fullName' })
+export class FullNamePipe implements PipeTransform {
+ transform(user: any): string {
+ let fullName = '';
+ if (user) {
+ if (user.firstName) {
+ fullName += user.firstName;
+ }
+ if (user.lastName) {
+ fullName += fullName.length > 0 ? ' ' : '';
+ fullName += user.lastName;
+ }
+ }
+ return fullName;
+ }
+}
diff --git a/lib/core/pipes/pipe.module.ts b/lib/core/pipes/pipe.module.ts
index 2b71703d1a..e9e7fbdc38 100644
--- a/lib/core/pipes/pipe.module.ts
+++ b/lib/core/pipes/pipe.module.ts
@@ -24,6 +24,7 @@ import { NodeNameTooltipPipe } from './node-name-tooltip.pipe';
import { HighlightPipe } from './text-highlight.pipe';
import { TimeAgoPipe } from './time-ago.pipe';
import { InitialUsernamePipe } from './user-initial.pipe';
+import { FullNamePipe } from './full-name.pipe';
@NgModule({
imports: [
@@ -35,6 +36,7 @@ import { InitialUsernamePipe } from './user-initial.pipe';
TimeAgoPipe,
MimeTypeIconPipe,
InitialUsernamePipe,
+ FullNamePipe,
NodeNameTooltipPipe
],
providers: [
@@ -51,6 +53,7 @@ import { InitialUsernamePipe } from './user-initial.pipe';
TimeAgoPipe,
MimeTypeIconPipe,
InitialUsernamePipe,
+ FullNamePipe,
NodeNameTooltipPipe
]
})
diff --git a/lib/core/pipes/public-api.ts b/lib/core/pipes/public-api.ts
index 3ff5d5af91..6d3a4c16de 100644
--- a/lib/core/pipes/public-api.ts
+++ b/lib/core/pipes/public-api.ts
@@ -21,5 +21,6 @@ export * from './node-name-tooltip.pipe';
export * from './text-highlight.pipe';
export * from './time-ago.pipe';
export * from './user-initial.pipe';
+export * from './full-name.pipe';
export * from './pipe.module';
diff --git a/lib/process-services/process-list/components/process-list.component.spec.ts b/lib/process-services/process-list/components/process-list.component.spec.ts
index db27e934df..0628999770 100644
--- a/lib/process-services/process-list/components/process-list.component.spec.ts
+++ b/lib/process-services/process-list/components/process-list.component.spec.ts
@@ -463,7 +463,7 @@ describe('ProcessInstanceListComponent', () => {
-