mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#ADF-452-userinfo show full name on the banner (#1814)
* #ADF-452-userinfo show full name on the banner * #ADF-452 - added improvement from PR
This commit is contained in:
@@ -19,11 +19,8 @@
|
|||||||
export { BpmUserModel } from '../models/bpm-user.model';
|
export { BpmUserModel } from '../models/bpm-user.model';
|
||||||
export { BpmUserService } from '../services/bpm-user.service';
|
export { BpmUserService } from '../services/bpm-user.service';
|
||||||
|
|
||||||
import { BpmUserModel } from '../models/bpm-user.model';
|
export var fakeBpmUserNoImage = {
|
||||||
import { Observable } from 'rxjs/Rx';
|
apps: [],
|
||||||
|
|
||||||
export var fakeBpmUserNoImage: BpmUserModel = {
|
|
||||||
apps: {},
|
|
||||||
capabilities: 'fake-capability',
|
capabilities: 'fake-capability',
|
||||||
company: 'fake-company',
|
company: 'fake-company',
|
||||||
created: 'fake-create-date',
|
created: 'fake-create-date',
|
||||||
@@ -32,7 +29,7 @@ export var fakeBpmUserNoImage: BpmUserModel = {
|
|||||||
firstName: 'fake-first-name',
|
firstName: 'fake-first-name',
|
||||||
lastName: 'fake-last-name',
|
lastName: 'fake-last-name',
|
||||||
fullname: 'fake-full-name',
|
fullname: 'fake-full-name',
|
||||||
groups: {},
|
groups: [],
|
||||||
id: 'fake-id',
|
id: 'fake-id',
|
||||||
lastUpdate: 'fake-update-date',
|
lastUpdate: 'fake-update-date',
|
||||||
latestSyncTimeStamp: 'fake-timestamp',
|
latestSyncTimeStamp: 'fake-timestamp',
|
||||||
@@ -45,17 +42,17 @@ export var fakeBpmUserNoImage: BpmUserModel = {
|
|||||||
type: 'fake-type'
|
type: 'fake-type'
|
||||||
};
|
};
|
||||||
|
|
||||||
export var fakeBpmUser: BpmUserModel = {
|
export var fakeBpmUser = {
|
||||||
apps: {},
|
apps: [],
|
||||||
capabilities: 'fake-capability',
|
capabilities: null,
|
||||||
company: 'fake-company',
|
company: 'fake-company',
|
||||||
created: 'fake-create-date',
|
created: 'fake-create-date',
|
||||||
email: 'fakeBpm@fake.com',
|
email: 'fakeBpm@fake.com',
|
||||||
externalId: 'fake-external-id',
|
externalId: 'fake-external-id',
|
||||||
firstName: 'fake-first-name',
|
firstName: 'fake-bpm-first-name',
|
||||||
lastName: 'fake-last-name',
|
lastName: 'fake-bpm-last-name',
|
||||||
fullname: 'fake-full-name',
|
fullname: 'fake-bpm-full-name',
|
||||||
groups: {},
|
groups: [],
|
||||||
id: 'fake-id',
|
id: 'fake-id',
|
||||||
lastUpdate: 'fake-update-date',
|
lastUpdate: 'fake-update-date',
|
||||||
latestSyncTimeStamp: 'fake-timestamp',
|
latestSyncTimeStamp: 'fake-timestamp',
|
||||||
@@ -68,8 +65,8 @@ export var fakeBpmUser: BpmUserModel = {
|
|||||||
type: 'fake-type'
|
type: 'fake-type'
|
||||||
};
|
};
|
||||||
|
|
||||||
export var fakeBpmEditedUser: BpmUserModel = {
|
export var fakeBpmEditedUser = {
|
||||||
apps: {},
|
apps: [],
|
||||||
capabilities: 'fake-capability',
|
capabilities: 'fake-capability',
|
||||||
company: 'fake-company',
|
company: 'fake-company',
|
||||||
created: 'fake-create-date',
|
created: 'fake-create-date',
|
||||||
@@ -78,7 +75,7 @@ export var fakeBpmEditedUser: BpmUserModel = {
|
|||||||
firstName: 'fake-first-name',
|
firstName: 'fake-first-name',
|
||||||
lastName: 'fake-last-name',
|
lastName: 'fake-last-name',
|
||||||
fullname: 'fake-full-name',
|
fullname: 'fake-full-name',
|
||||||
groups: {},
|
groups: [],
|
||||||
id: 'fake-id',
|
id: 'fake-id',
|
||||||
lastUpdate: 'fake-update-date',
|
lastUpdate: 'fake-update-date',
|
||||||
latestSyncTimeStamp: 'fake-timestamp',
|
latestSyncTimeStamp: 'fake-timestamp',
|
||||||
@@ -90,34 +87,3 @@ export var fakeBpmEditedUser: BpmUserModel = {
|
|||||||
tenantPictureId: 'fake-tenant-picture-id',
|
tenantPictureId: 'fake-tenant-picture-id',
|
||||||
type: 'fake-type'
|
type: 'fake-type'
|
||||||
};
|
};
|
||||||
|
|
||||||
export class FakeBpmUserService {
|
|
||||||
|
|
||||||
lastPromise: Observable<BpmUserModel>;
|
|
||||||
public userNeeded = 0;
|
|
||||||
usersList = [fakeBpmUser, fakeBpmUserNoImage, fakeBpmEditedUser];
|
|
||||||
|
|
||||||
getUserInfo(userName: string) {
|
|
||||||
return this.lastPromise = Observable.of(this.usersList[this.userNeeded]);
|
|
||||||
};
|
|
||||||
|
|
||||||
getCurrentUserInfo() {
|
|
||||||
return this.getUserInfo('fake-id');
|
|
||||||
};
|
|
||||||
|
|
||||||
getCurrentUserProfileImage() {
|
|
||||||
return Observable.of(this.usersList[this.userNeeded].pictureId);
|
|
||||||
};
|
|
||||||
|
|
||||||
respondWithTheUserWithoutImage() {
|
|
||||||
this.userNeeded = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
respondWithTheUserWithImage() {
|
|
||||||
this.userNeeded = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
respondWithEditedUser() {
|
|
||||||
this.userNeeded = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -19,11 +19,9 @@
|
|||||||
export { EcmUserModel } from '../models/ecm-user.model';
|
export { EcmUserModel } from '../models/ecm-user.model';
|
||||||
export { EcmUserService } from '../services/ecm-user.service';
|
export { EcmUserService } from '../services/ecm-user.service';
|
||||||
|
|
||||||
import { EcmUserModel } from '../models/ecm-user.model';
|
|
||||||
import { EcmCompanyModel } from '../models/ecm-company.model';
|
import { EcmCompanyModel } from '../models/ecm-company.model';
|
||||||
import { Observable } from 'rxjs/Rx';
|
|
||||||
|
|
||||||
export var fakeEcmCompany: EcmCompanyModel = {
|
export let fakeEcmCompany: EcmCompanyModel = {
|
||||||
organization: 'company-fake-name',
|
organization: 'company-fake-name',
|
||||||
address1: 'fake-address-1',
|
address1: 'fake-address-1',
|
||||||
address2: 'fake-address-2',
|
address2: 'fake-address-2',
|
||||||
@@ -34,7 +32,28 @@ export var fakeEcmCompany: EcmCompanyModel = {
|
|||||||
email: 'fakeCompany@fake.com'
|
email: 'fakeCompany@fake.com'
|
||||||
};
|
};
|
||||||
|
|
||||||
export var fakeEcmUserNoImage: EcmUserModel = {
|
export let fakeEcmUser = {
|
||||||
|
id: 'fake-id',
|
||||||
|
firstName: 'fake-first-name',
|
||||||
|
lastName: 'fake-last-name',
|
||||||
|
description: 'i am a fake user for test',
|
||||||
|
avatarId: 'fake-avatar-id',
|
||||||
|
email: 'fakeEcm@ecmUser.com',
|
||||||
|
skypeId: 'fake-skype-id',
|
||||||
|
googleId: 'fake-googleId-id',
|
||||||
|
instantMessageId: 'fake-instantMessageId-id',
|
||||||
|
company: fakeEcmCompany,
|
||||||
|
jobTitle: 'test job',
|
||||||
|
location: 'fake location',
|
||||||
|
mobile: '000000000',
|
||||||
|
telephone: '11111111',
|
||||||
|
statusUpdatedAt: 'fake-date',
|
||||||
|
userStatus: 'active',
|
||||||
|
enabled: true,
|
||||||
|
emailNotificationsEnabled: true
|
||||||
|
};
|
||||||
|
|
||||||
|
export let fakeEcmUserNoImage = {
|
||||||
id: 'fake-id',
|
id: 'fake-id',
|
||||||
firstName: 'fake-first-name',
|
firstName: 'fake-first-name',
|
||||||
lastName: 'fake-last-name',
|
lastName: 'fake-last-name',
|
||||||
@@ -55,7 +74,7 @@ export var fakeEcmUserNoImage: EcmUserModel = {
|
|||||||
emailNotificationsEnabled: true
|
emailNotificationsEnabled: true
|
||||||
};
|
};
|
||||||
|
|
||||||
export var fakeEcmUser: EcmUserModel = {
|
export let fakeEcmEditedUser = {
|
||||||
id: 'fake-id',
|
id: 'fake-id',
|
||||||
firstName: 'fake-first-name',
|
firstName: 'fake-first-name',
|
||||||
lastName: 'fake-last-name',
|
lastName: 'fake-last-name',
|
||||||
@@ -75,58 +94,3 @@ export var fakeEcmUser: EcmUserModel = {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
emailNotificationsEnabled: true
|
emailNotificationsEnabled: true
|
||||||
};
|
};
|
||||||
|
|
||||||
export var fakeEcmEditedUser: EcmUserModel = {
|
|
||||||
id: 'fake-id',
|
|
||||||
firstName: 'fake-first-name',
|
|
||||||
lastName: 'fake-last-name',
|
|
||||||
description: 'i am a fake user for test',
|
|
||||||
avatarId: 'fake-avatar-id',
|
|
||||||
email: 'fakeEcm@ecmUser.com',
|
|
||||||
skypeId: 'fake-skype-id',
|
|
||||||
googleId: 'fake-googleId-id',
|
|
||||||
instantMessageId: 'fake-instantMessageId-id',
|
|
||||||
company: fakeEcmCompany,
|
|
||||||
jobTitle: 'test job',
|
|
||||||
location: 'fake location',
|
|
||||||
mobile: '000000000',
|
|
||||||
telephone: '11111111',
|
|
||||||
statusUpdatedAt: 'fake-date',
|
|
||||||
userStatus: 'active',
|
|
||||||
enabled: true,
|
|
||||||
emailNotificationsEnabled: true
|
|
||||||
};
|
|
||||||
|
|
||||||
export class FakeEcmUserService {
|
|
||||||
|
|
||||||
lastPromise: Observable<EcmUserModel>;
|
|
||||||
public userNeeded = 0;
|
|
||||||
usersList = [fakeEcmUser, fakeEcmUserNoImage, fakeEcmEditedUser];
|
|
||||||
|
|
||||||
getUserInfo(userName: string) {
|
|
||||||
return this.lastPromise = Observable.of(this.usersList[this.userNeeded]);
|
|
||||||
};
|
|
||||||
|
|
||||||
getCurrentUserInfo() {
|
|
||||||
return this.getUserInfo('fake-id');
|
|
||||||
};
|
|
||||||
|
|
||||||
getUserProfileImage(avatarId: string) {
|
|
||||||
if (avatarId) {
|
|
||||||
return 'src/assets/images/ecmImg.gif';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
respondWithTheUserWithoutImage() {
|
|
||||||
this.userNeeded = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
respondWithTheUserWithImage() {
|
|
||||||
this.userNeeded = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
respondWithEditedUser() {
|
|
||||||
this.userNeeded = 2;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@@ -27,12 +27,12 @@
|
|||||||
alt="ecm-profile-image"
|
alt="ecm-profile-image"
|
||||||
(error)="onImageLoadingError($event)"
|
(error)="onImageLoadingError($event)"
|
||||||
[src]="getEcmUserAvatar()"/>
|
[src]="getEcmUserAvatar()"/>
|
||||||
<h2 class="mdl-card__title-text" id="ecm-username">{{getUserNameHeaderFor('ECM')}}</h2>
|
<h2 class="mdl-card__title-text" id="ecm-username">{{ecmUser.fullNameDisplay}}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-card__supporting-text">
|
<div class="mdl-card__supporting-text">
|
||||||
<li class="mdl-list__item mdl-list__item--two-line">
|
<li class="mdl-list__item mdl-list__item--two-line">
|
||||||
<span class="mdl-list__item-primary-content">
|
<span class="mdl-list__item-primary-content">
|
||||||
<span id="ecm-full-name" class="truncate-long-names">{{getEcmFullName()}}</span>
|
<span id="ecm-full-name" class="truncate-long-names">{{ecmUser.fullNameDisplay}}</span>
|
||||||
<span id="ecm-email" class="mdl-list__item-sub-title">{{ecmUser.email}}</span>
|
<span id="ecm-email" class="mdl-list__item-sub-title">{{ecmUser.email}}</span>
|
||||||
</span>
|
</span>
|
||||||
<span id="ecm-job-title" class="mdl-list__item-secondary-content user-info__job-title">
|
<span id="ecm-job-title" class="mdl-list__item-secondary-content user-info__job-title">
|
||||||
@@ -55,12 +55,12 @@
|
|||||||
alt="bpm-profile-image"
|
alt="bpm-profile-image"
|
||||||
(error)="onImageLoadingError($event)"
|
(error)="onImageLoadingError($event)"
|
||||||
[src]="getBpmUserAvatar()"/>
|
[src]="getBpmUserAvatar()"/>
|
||||||
<h2 class="mdl-card__title-text" id="bpm-username">{{getUserNameHeaderFor('BPM')}}</h2>
|
<h2 class="mdl-card__title-text" id="bpm-username">{{bpmUser.fullNameDisplay}}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-card__supporting-text">
|
<div class="mdl-card__supporting-text">
|
||||||
<li class="mdl-list__item mdl-list__item--two-line">
|
<li class="mdl-list__item mdl-list__item--two-line">
|
||||||
<span class="mdl-list__item-primary-content">
|
<span class="mdl-list__item-primary-content">
|
||||||
<span id="bpm-full-name" class="truncate-long-names">{{ getBpmFullName() }}</span>
|
<span id="bpm-full-name" class="truncate-long-names">{{ bpmUser.fullNameDisplay }}</span>
|
||||||
<span id="bpm-email" class="mdl-list__item-sub-title">{{bpmUser.email}}</span>
|
<span id="bpm-email" class="mdl-list__item-sub-title">{{bpmUser.email}}</span>
|
||||||
</span>
|
</span>
|
||||||
<span id="bpm-tenant" class="mdl-list__item-secondary-content user-info__job-title">
|
<span id="bpm-tenant" class="mdl-list__item-secondary-content user-info__job-title">
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
import { UserInfoComponent } from './user-info.component';
|
import { UserInfoComponent } from './user-info.component';
|
||||||
import { EcmUserService } from '../services/ecm-user.service';
|
import { EcmUserService } from '../services/ecm-user.service';
|
||||||
import { BpmUserService } from '../services/bpm-user.service';
|
import { BpmUserService } from '../services/bpm-user.service';
|
||||||
import { BpmUserModel } from '../models/bpm-user.model';
|
import { fakeBpmUser } from '../assets/fake-bpm-user.service.mock';
|
||||||
import { TranslationMock } from '../assets/translation.service.mock';
|
import { TranslationMock } from '../assets/translation.service.mock';
|
||||||
import {
|
import {
|
||||||
CoreModule,
|
CoreModule,
|
||||||
@@ -27,47 +27,10 @@ import {
|
|||||||
AlfrescoTranslationService
|
AlfrescoTranslationService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||||
|
import { BpmUserModel } from './../models/bpm-user.model';
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
const fakeBpmUser: BpmUserModel = <BpmUserModel>{
|
|
||||||
'id': 'fake-id',
|
|
||||||
'firstName': 'fake-bpm-first-name',
|
|
||||||
'lastName': 'fake-bpm-last-name',
|
|
||||||
'created': null,
|
|
||||||
'lastUpdate': null,
|
|
||||||
'latestSyncTimeStamp': null,
|
|
||||||
'email': 'fake-bpm-email',
|
|
||||||
'externalId': null,
|
|
||||||
'company': null,
|
|
||||||
'pictureId': null,
|
|
||||||
'fullname': 'fake-full-name',
|
|
||||||
'password': null,
|
|
||||||
'type': 'enterprise',
|
|
||||||
'status': 'active',
|
|
||||||
'tenantId': '1',
|
|
||||||
'groups': [{
|
|
||||||
'id': 1,
|
|
||||||
'name': 'analytics-users',
|
|
||||||
'externalId': null,
|
|
||||||
'status': 'active',
|
|
||||||
'tenantId': 1,
|
|
||||||
'type': 0,
|
|
||||||
'parentGroupId': null,
|
|
||||||
'lastSyncTimeStamp': null,
|
|
||||||
'userCount': null,
|
|
||||||
'users': null,
|
|
||||||
'capabilities': null,
|
|
||||||
'groups': null,
|
|
||||||
'manager': null
|
|
||||||
}],
|
|
||||||
'capabilities': null,
|
|
||||||
'apps': [],
|
|
||||||
'primaryGroup': null,
|
|
||||||
'tenantPictureId': null,
|
|
||||||
'tenantName': 'fake-tenant-name'
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('User info component', () => {
|
describe('User info component', () => {
|
||||||
|
|
||||||
let userInfoComp: UserInfoComponent;
|
let userInfoComp: UserInfoComponent;
|
||||||
@@ -90,7 +53,7 @@ describe('User info component', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
EcmUserService,
|
EcmUserService,
|
||||||
BpmUserService,
|
BpmUserService,
|
||||||
{provide: AlfrescoTranslationService, useClass: TranslationMock}
|
{ provide: AlfrescoTranslationService, useClass: TranslationMock }
|
||||||
]
|
]
|
||||||
}).compileComponents().then(() => {
|
}).compileComponents().then(() => {
|
||||||
fixture = TestBed.createComponent(UserInfoComponent);
|
fixture = TestBed.createComponent(UserInfoComponent);
|
||||||
@@ -119,18 +82,6 @@ describe('User info component', () => {
|
|||||||
expect(element.querySelector('#user-profile-lists')).toBeNull();
|
expect(element.querySelector('#user-profile-lists')).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should format null string values in empty value', () => {
|
|
||||||
let res = userInfoComp.formatValue('null');
|
|
||||||
expect(res).toBe('');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return the value when it is not null string', () => {
|
|
||||||
let res = userInfoComp.formatValue('fake-value');
|
|
||||||
expect(res).toBeDefined();
|
|
||||||
expect(res).not.toBeNull();
|
|
||||||
expect(res).toEqual('fake-value');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return the anonymous avatar when users do not have images', () => {
|
it('should return the anonymous avatar when users do not have images', () => {
|
||||||
let event = <any> {
|
let event = <any> {
|
||||||
target: {
|
target: {
|
||||||
@@ -156,6 +107,32 @@ describe('User info component', () => {
|
|||||||
jasmine.Ajax.uninstall();
|
jasmine.Ajax.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show ecm only last name when user first name is null ', async(() => {
|
||||||
|
fixture.detectChanges();
|
||||||
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
status: 200,
|
||||||
|
contentType: 'json',
|
||||||
|
responseText: {
|
||||||
|
'entry': {
|
||||||
|
'id': 'fake-id',
|
||||||
|
'firstName': null,
|
||||||
|
'lastName': 'fake-ecm-last-name',
|
||||||
|
'description': 'i am a fake user for test',
|
||||||
|
'avatarId': 'fake-avatar-id',
|
||||||
|
'email': 'fakeEcm@ecmUser.com'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
fixture.whenStable().then(() => {
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
|
expect(element.querySelector('#ecm-username')).toBeDefined();
|
||||||
|
expect(element.querySelector('#ecm-username').textContent).not.toContain('fake-ecm-first-name');
|
||||||
|
expect(element.querySelector('#ecm-username').textContent).not.toContain('null');
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
describe('and has image', () => {
|
describe('and has image', () => {
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -180,21 +157,13 @@ describe('User info component', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should show ecm only last name when user first name is null ', async(() => {
|
it('should get the ecm current user image from the service', async(() => {
|
||||||
userInfoComp.ecmUser.firstName = null;
|
|
||||||
fixture.detectChanges();
|
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
|
||||||
expect(element.querySelector('#ecm-username')).toBeDefined();
|
|
||||||
expect(element.querySelector('#ecm-username').textContent).not.toContain('fake-ecm-first-name');
|
|
||||||
}));
|
|
||||||
|
|
||||||
xit('should get the ecm current user image from the service', async(() => {
|
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#logged-user-img')).toBeDefined();
|
expect(element.querySelector('#logged-user-img')).toBeDefined();
|
||||||
expect(element.querySelector('#logged-user-img').getAttribute('src')).toContain('assets/images/ecmImg.gif');
|
expect(element.querySelector('#logged-user-img').getAttribute('src')).toContain('assets/images/ecmImg.gif');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
xit('should get the ecm user informations from the service', async(() => {
|
it('should get the ecm user informations from the service', async(() => {
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#ecm_username')).toBeDefined();
|
expect(element.querySelector('#ecm_username')).toBeDefined();
|
||||||
expect(element.querySelector('#ecm_title')).toBeDefined();
|
expect(element.querySelector('#ecm_title')).toBeDefined();
|
||||||
@@ -243,13 +212,10 @@ describe('User info component', () => {
|
|||||||
|
|
||||||
describe('when user is logged on bpm', () => {
|
describe('when user is logged on bpm', () => {
|
||||||
|
|
||||||
let fakeBpmUserForTest;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(stubAuthService, 'isBpmLoggedIn').and.returnValue(true);
|
spyOn(stubAuthService, 'isBpmLoggedIn').and.returnValue(true);
|
||||||
spyOn(stubAuthService, 'isLoggedIn').and.returnValue(true);
|
spyOn(stubAuthService, 'isLoggedIn').and.returnValue(true);
|
||||||
jasmine.Ajax.install();
|
jasmine.Ajax.install();
|
||||||
fakeBpmUserForTest = fakeBpmUser;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -257,8 +223,8 @@ describe('User info component', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'application/json',
|
||||||
responseText: fakeBpmUserForTest
|
responseText: JSON.stringify(fakeBpmUser)
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -270,6 +236,13 @@ describe('User info component', () => {
|
|||||||
jasmine.Ajax.uninstall();
|
jasmine.Ajax.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show full name next the user image', async(() => {
|
||||||
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
|
expect(element.querySelector('#bpm-username')).toBeDefined();
|
||||||
|
expect(element.querySelector('#bpm-username').innerHTML).toContain('fake-bpm-first-name fake-bpm-last-name');
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
it('should get the bpm current user image from the service', async(() => {
|
it('should get the bpm current user image from the service', async(() => {
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#logged-user-img')).toBeDefined();
|
expect(element.querySelector('#logged-user-img')).toBeDefined();
|
||||||
@@ -279,27 +252,25 @@ describe('User info component', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should show last name if first name is null', async(() => {
|
it('should show last name if first name is null', async(() => {
|
||||||
userInfoComp.bpmUser.firstName = null;
|
let wrongBpmUser: BpmUserModel = new BpmUserModel({
|
||||||
|
firstName: null,
|
||||||
|
lastName: 'fake-last-name'
|
||||||
|
});
|
||||||
|
userInfoComp.bpmUser = wrongBpmUser;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#bpm-username')).not.toBeNull();
|
expect(element.querySelector('#bpm-username')).not.toBeNull();
|
||||||
expect(element.querySelector('#bpm-username').textContent).toContain('fake-bpm-last-name');
|
expect(element.querySelector('#bpm-username').textContent).toContain('fake-last-name');
|
||||||
|
expect(element.querySelector('#bpm-username').textContent).not.toContain('fake-bpm-first-name');
|
||||||
}));
|
|
||||||
|
|
||||||
it('should show full name if first and last name are null', async(() => {
|
|
||||||
userInfoComp.bpmUser.firstName = null;
|
|
||||||
userInfoComp.bpmUser.lastName = null;
|
|
||||||
fixture.detectChanges();
|
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
|
||||||
expect(element.querySelector('#bpm-username')).toBeDefined();
|
|
||||||
expect(element.querySelector('#bpm-username').innerHTML).toContain('fake-full-name');
|
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should not show first name if it is null string', async(() => {
|
it('should not show first name if it is null string', async(() => {
|
||||||
userInfoComp.bpmUser.firstName = 'null';
|
let wrongFirstNameBpmUser: BpmUserModel = new BpmUserModel({
|
||||||
userInfoComp.bpmUser.lastName = 'fake-last-name';
|
firstName: 'null',
|
||||||
|
lastName: 'fake-last-name'
|
||||||
|
});
|
||||||
|
userInfoComp.bpmUser = wrongFirstNameBpmUser;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#bpm-full-name')).toBeDefined();
|
expect(element.querySelector('#bpm-full-name')).toBeDefined();
|
||||||
@@ -308,8 +279,11 @@ describe('User info component', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should not show last name if it is null string', async(() => {
|
it('should not show last name if it is null string', async(() => {
|
||||||
userInfoComp.bpmUser.firstName = 'fake-first-name';
|
let wrongLastNameBpmUser: BpmUserModel = new BpmUserModel({
|
||||||
userInfoComp.bpmUser.lastName = 'null';
|
firstName: 'fake-first-name',
|
||||||
|
lastName: 'null'
|
||||||
|
});
|
||||||
|
userInfoComp.bpmUser = wrongLastNameBpmUser;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
expect(element.querySelector('#userinfo_container')).toBeDefined();
|
||||||
expect(element.querySelector('#bpm-full-name')).toBeDefined();
|
expect(element.querySelector('#bpm-full-name')).toBeDefined();
|
||||||
|
@@ -81,7 +81,7 @@ export class UserInfoComponent implements OnInit {
|
|||||||
if (this.authService.isEcmLoggedIn()) {
|
if (this.authService.isEcmLoggedIn()) {
|
||||||
this.ecmUserService.getCurrentUserInfo()
|
this.ecmUserService.getCurrentUserInfo()
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
this.ecmUser = <EcmUserModel> res;
|
this.ecmUser = new EcmUserModel(res);
|
||||||
this.getEcmAvatar();
|
this.getEcmAvatar();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -95,7 +95,7 @@ export class UserInfoComponent implements OnInit {
|
|||||||
if (this.authService.isBpmLoggedIn()) {
|
if (this.authService.isBpmLoggedIn()) {
|
||||||
this.bpmUserService.getCurrentUserInfo()
|
this.bpmUserService.getCurrentUserInfo()
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
this.bpmUser = <BpmUserModel> res;
|
this.bpmUser = new BpmUserModel(res);
|
||||||
});
|
});
|
||||||
this.bpmUserImage = this.bpmUserService.getCurrentUserProfileImage();
|
this.bpmUserImage = this.bpmUserService.getCurrentUserProfileImage();
|
||||||
} else {
|
} else {
|
||||||
@@ -115,32 +115,6 @@ export class UserInfoComponent implements OnInit {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
getEcmFullName(): string {
|
|
||||||
if (this.ecmUser) {
|
|
||||||
return `${this.formatValue(this.ecmUser.firstName)} ${this.formatValue(this.ecmUser.lastName)}`.trim();
|
|
||||||
}
|
|
||||||
return 'N/A';
|
|
||||||
}
|
|
||||||
|
|
||||||
getBpmFullName(): string {
|
|
||||||
if (this.bpmUser) {
|
|
||||||
return `${this.formatValue(this.bpmUser.firstName)} ${this.formatValue(this.bpmUser.lastName)}`.trim();
|
|
||||||
}
|
|
||||||
return 'N/A';
|
|
||||||
}
|
|
||||||
|
|
||||||
getUserNameHeaderFor(env: string): string {
|
|
||||||
if (this.ecmUser && env === 'ECM') {
|
|
||||||
return this.ecmUser.firstName || this.ecmUser.lastName;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.bpmUser && env === 'BPM') {
|
|
||||||
return this.formatValue(this.bpmUser.firstName) ||
|
|
||||||
this.formatValue(this.bpmUser.lastName) ||
|
|
||||||
this.formatValue(this.bpmUser.fullname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private getEcmAvatar() {
|
private getEcmAvatar() {
|
||||||
this.ecmUserImage = this.ecmUserService.getUserProfileImage(this.ecmUser.avatarId);
|
this.ecmUserImage = this.ecmUserService.getUserProfileImage(this.ecmUser.avatarId);
|
||||||
}
|
}
|
||||||
@@ -156,8 +130,4 @@ export class UserInfoComponent implements OnInit {
|
|||||||
getEcmUserAvatar() {
|
getEcmUserAvatar() {
|
||||||
return this.ecmUserImage;
|
return this.ecmUserImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
formatValue(value: string) {
|
|
||||||
return value && value !== 'null' ? value : '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,7 @@ export class BpmUserModel {
|
|||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
fullname: string;
|
fullname: string;
|
||||||
|
fullNameDisplay: string;
|
||||||
groups: any;
|
groups: any;
|
||||||
id: string;
|
id: string;
|
||||||
lastUpdate: string;
|
lastUpdate: string;
|
||||||
@@ -36,4 +37,32 @@ export class BpmUserModel {
|
|||||||
tenantName: string;
|
tenantName: string;
|
||||||
tenantPictureId: string;
|
tenantPictureId: string;
|
||||||
type: string;
|
type: string;
|
||||||
|
|
||||||
|
constructor(obj?: any) {
|
||||||
|
this.apps = obj && obj.apps || null;
|
||||||
|
this.capabilities = obj && obj.capabilities || false;
|
||||||
|
this.company = obj && obj.company || null;
|
||||||
|
this.created = obj && obj.created || null;
|
||||||
|
this.email = obj && obj.email || null;
|
||||||
|
this.externalId = obj && obj.externalId || null;
|
||||||
|
this.firstName = obj && obj.firstName;
|
||||||
|
this.lastName = obj && obj.lastName;
|
||||||
|
this.fullname = obj && obj.fullname;
|
||||||
|
this.fullNameDisplay = obj ? this.formatValue(obj.firstName).trim() + ' ' + this.formatValue(obj.lastName).trim() : null;
|
||||||
|
this.groups = obj && obj.groups || null;
|
||||||
|
this.id = obj && obj.id || null;
|
||||||
|
this.lastUpdate = obj && obj.lastUpdate;
|
||||||
|
this.latestSyncTimeStamp = obj && obj.latestSyncTimeStamp;
|
||||||
|
this.password = obj && obj.password;
|
||||||
|
this.pictureId = obj && obj.pictureId;
|
||||||
|
this.status = obj && obj.status;
|
||||||
|
this.tenantId = obj && obj.tenantId;
|
||||||
|
this.tenantName = obj && obj.tenantName;
|
||||||
|
this.tenantPictureId = obj && obj.tenantPictureId;
|
||||||
|
this.type = obj && obj.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
private formatValue(value: string): string {
|
||||||
|
return value && value !== 'null' ? value : 'N/A';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,22 +18,49 @@
|
|||||||
import { EcmCompanyModel } from './ecm-company.model';
|
import { EcmCompanyModel } from './ecm-company.model';
|
||||||
|
|
||||||
export class EcmUserModel {
|
export class EcmUserModel {
|
||||||
id: string;
|
id: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
description: string;
|
fullNameDisplay: string;
|
||||||
avatarId: string;
|
description: string;
|
||||||
email: string;
|
avatarId: string;
|
||||||
skypeId: string;
|
email: string;
|
||||||
googleId: string;
|
skypeId: string;
|
||||||
instantMessageId: string;
|
googleId: string;
|
||||||
jobTitle: string;
|
instantMessageId: string;
|
||||||
location: string;
|
jobTitle: string;
|
||||||
company: EcmCompanyModel;
|
location: string;
|
||||||
mobile: string;
|
company: EcmCompanyModel;
|
||||||
telephone: string;
|
mobile: string;
|
||||||
statusUpdatedAt: string;
|
telephone: string;
|
||||||
userStatus: string;
|
statusUpdatedAt: string;
|
||||||
enabled: boolean;
|
userStatus: string;
|
||||||
emailNotificationsEnabled: boolean;
|
enabled: boolean;
|
||||||
|
emailNotificationsEnabled: boolean;
|
||||||
|
|
||||||
|
constructor(obj?: any) {
|
||||||
|
this.id = obj && obj.id || null;
|
||||||
|
this.firstName = obj && obj.firstName;
|
||||||
|
this.lastName = obj && obj.lastName;
|
||||||
|
this.fullNameDisplay = obj ? this.formatValue(obj.firstName).trim() + ' ' + this.formatValue(obj.lastName).trim() : null;
|
||||||
|
this.description = obj && obj.description || null;
|
||||||
|
this.avatarId = obj && obj.avatarId || null;
|
||||||
|
this.email = obj && obj.email || null;
|
||||||
|
this.skypeId = obj && obj.skypeId;
|
||||||
|
this.googleId = obj && obj.googleId;
|
||||||
|
this.instantMessageId = obj && obj.instantMessageId;
|
||||||
|
this.jobTitle = obj && obj.jobTitle || null;
|
||||||
|
this.location = obj && obj.location || null;
|
||||||
|
this.company = obj && obj.company;
|
||||||
|
this.mobile = obj && obj.mobile;
|
||||||
|
this.telephone = obj && obj.telephone;
|
||||||
|
this.statusUpdatedAt = obj && obj.statusUpdatedAt;
|
||||||
|
this.userStatus = obj && obj.userStatus;
|
||||||
|
this.enabled = obj && obj.enabled;
|
||||||
|
this.emailNotificationsEnabled = obj && obj.emailNotificationsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private formatValue(value: string) {
|
||||||
|
return value && value !== 'null' ? value : 'N/A';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,31 +15,38 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { ReflectiveInjector } from '@angular/core';
|
||||||
import { CoreModule, AlfrescoAuthenticationService, AlfrescoApiService } from 'ng2-alfresco-core';
|
import {
|
||||||
|
AlfrescoAuthenticationService,
|
||||||
|
AlfrescoSettingsService,
|
||||||
|
AlfrescoApiService,
|
||||||
|
StorageService,
|
||||||
|
LogService
|
||||||
|
} from 'ng2-alfresco-core';
|
||||||
import { BpmUserService } from '../services/bpm-user.service';
|
import { BpmUserService } from '../services/bpm-user.service';
|
||||||
// import { fakeBpmUser } from '../assets/fake-bpm-user.service.mock';
|
import { BpmUserModel } from '../models/bpm-user.model';
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
describe('BpmUserService', () => {
|
describe('Bpm user service', () => {
|
||||||
|
|
||||||
let service: BpmUserService;
|
let service, injector;
|
||||||
let authService: AlfrescoAuthenticationService;
|
|
||||||
let apiService: AlfrescoApiService;
|
beforeEach(() => {
|
||||||
|
injector = ReflectiveInjector.resolveAndCreate([
|
||||||
|
AlfrescoSettingsService,
|
||||||
|
AlfrescoApiService,
|
||||||
|
AlfrescoAuthenticationService,
|
||||||
|
BpmUserService,
|
||||||
|
StorageService,
|
||||||
|
LogService
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
service = injector.get(BpmUserService);
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
|
||||||
imports: [
|
|
||||||
CoreModule.forRoot()
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
BpmUserService
|
|
||||||
]
|
|
||||||
});
|
|
||||||
service = TestBed.get(BpmUserService);
|
|
||||||
authService = TestBed.get(AlfrescoAuthenticationService);
|
|
||||||
apiService = TestBed.get(AlfrescoApiService);
|
|
||||||
jasmine.Ajax.install();
|
jasmine.Ajax.install();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -47,36 +54,36 @@ describe('BpmUserService', () => {
|
|||||||
jasmine.Ajax.uninstall();
|
jasmine.Ajax.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: these tests do not make sense
|
|
||||||
|
|
||||||
describe('when user is logged in', () => {
|
describe('when user is logged in', () => {
|
||||||
|
|
||||||
/*
|
it('should be able to retrieve the user information', (done) => {
|
||||||
it('should be able to retrieve current user info', (done) => {
|
service.getCurrentUserInfo().subscribe((user: BpmUserModel) => {
|
||||||
service.getCurrentUserInfo().subscribe(
|
expect(user).toBeDefined();
|
||||||
(user) => {
|
expect(user.id).toBe(1);
|
||||||
expect(user.fakeBpmUser).toBeDefined();
|
expect(user.lastName).toBe('fake-last-name');
|
||||||
expect(user.fakeBpmUser.firstName).toEqual('fake-first-name');
|
expect(user.fullname).toBe('fake-full-name');
|
||||||
expect(user.fakeBpmUser.lastName).toEqual('fake-last-name');
|
done();
|
||||||
expect(user.fakeBpmUser.email).toEqual('fakeBpm@fake.com');
|
});
|
||||||
done();
|
|
||||||
});
|
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
status: 200,
|
'status': 200,
|
||||||
contentType: 'json',
|
contentType: 'application/json',
|
||||||
responseText: {fakeBpmUser}
|
responseText: JSON.stringify({
|
||||||
|
lastName: 'fake-last-name',
|
||||||
|
fullname: 'fake-full-name',
|
||||||
|
groups: [],
|
||||||
|
id: 1
|
||||||
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
xit('should retrieve avatar url for current user', () => {
|
it('should retrieve avatar url for current user', () => {
|
||||||
let path = service.getCurrentUserProfileImage();
|
let path = service.getCurrentUserProfileImage();
|
||||||
expect(path).toBeDefined();
|
expect(path).toBeDefined();
|
||||||
expect(path).toContain('/app/rest/admin/profile-picture');
|
expect(path).toContain('/app/rest/admin/profile-picture');
|
||||||
});
|
});
|
||||||
|
|
||||||
xit('should catch errors on call for profile', (done) => {
|
it('should catch errors on call for profile', (done) => {
|
||||||
service.getCurrentUserInfo().subscribe(() => {
|
service.getCurrentUserInfo().subscribe(() => {
|
||||||
}, () => {
|
}, () => {
|
||||||
done();
|
done();
|
||||||
|
@@ -15,11 +15,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
|
||||||
import { CoreModule, AlfrescoAuthenticationService, AlfrescoContentService } from 'ng2-alfresco-core';
|
|
||||||
import { EcmUserService } from '../services/ecm-user.service';
|
import { EcmUserService } from '../services/ecm-user.service';
|
||||||
import { fakeEcmUser } from '../assets/fake-ecm-user.service.mock';
|
import { fakeEcmUser } from '../assets/fake-ecm-user.service.mock';
|
||||||
|
import { ReflectiveInjector } from '@angular/core';
|
||||||
|
import {
|
||||||
|
AlfrescoAuthenticationService,
|
||||||
|
AlfrescoContentService,
|
||||||
|
AlfrescoSettingsService,
|
||||||
|
AlfrescoApiService,
|
||||||
|
StorageService,
|
||||||
|
LogService
|
||||||
|
} from 'ng2-alfresco-core';
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
describe('EcmUserService', () => {
|
describe('EcmUserService', () => {
|
||||||
@@ -27,30 +33,38 @@ describe('EcmUserService', () => {
|
|||||||
let service: EcmUserService;
|
let service: EcmUserService;
|
||||||
let authService: AlfrescoAuthenticationService;
|
let authService: AlfrescoAuthenticationService;
|
||||||
let contentService: AlfrescoContentService;
|
let contentService: AlfrescoContentService;
|
||||||
|
let injector;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
injector = ReflectiveInjector.resolveAndCreate([
|
||||||
imports: [
|
AlfrescoSettingsService,
|
||||||
CoreModule.forRoot()
|
AlfrescoApiService,
|
||||||
],
|
AlfrescoAuthenticationService,
|
||||||
providers: [
|
AlfrescoContentService,
|
||||||
EcmUserService
|
EcmUserService,
|
||||||
]
|
StorageService,
|
||||||
});
|
LogService
|
||||||
service = TestBed.get(EcmUserService);
|
]);
|
||||||
authService = TestBed.get(AlfrescoAuthenticationService);
|
});
|
||||||
contentService = TestBed.get(AlfrescoContentService);
|
|
||||||
|
beforeEach(() => {
|
||||||
|
service = injector.get(EcmUserService);
|
||||||
|
authService = injector.get(AlfrescoAuthenticationService);
|
||||||
|
contentService = injector.get(AlfrescoContentService);
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
jasmine.Ajax.install();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jasmine.Ajax.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when user is logged in', () => {
|
describe('when user is logged in', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
|
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
|
||||||
jasmine.Ajax.install();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jasmine.Ajax.uninstall();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to retrieve current user info', (done) => {
|
it('should be able to retrieve current user info', (done) => {
|
||||||
@@ -64,8 +78,8 @@ describe('EcmUserService', () => {
|
|||||||
});
|
});
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'application/json',
|
||||||
responseText: {entry: fakeEcmUser}
|
responseText: JSON.stringify({entry: fakeEcmUser})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user