mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
@@ -20,7 +20,7 @@ import { CoreStoryModule } from '../../testing/core.story.module';
|
||||
import { CommentListComponent } from './comment-list.component';
|
||||
import { CommentsModule } from '../comments.module';
|
||||
import { commentsTaskData, commentsNodeData } from '../mocks/comments.stories.mock';
|
||||
import { EcmUserService } from '../../services';
|
||||
import { CommentListServiceMock } from './mocks/comment-list.service.mock';
|
||||
|
||||
export default {
|
||||
component: CommentListComponent,
|
||||
@@ -29,7 +29,7 @@ export default {
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, CommentsModule],
|
||||
providers: [
|
||||
{ provide: EcmUserService, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } }
|
||||
{ provide: CommentListServiceMock, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } }
|
||||
]
|
||||
})
|
||||
],
|
||||
|
@@ -16,14 +16,13 @@
|
||||
*/
|
||||
|
||||
import { CommentModel } from '../../../models/comment.model';
|
||||
import { UserProcessModel } from '../../../models/user-process.model';
|
||||
|
||||
export const testUser = new UserProcessModel({
|
||||
export const testUser = {
|
||||
id: '1',
|
||||
firstName: 'Test',
|
||||
lastName: 'User',
|
||||
email: 'tu@domain.com'
|
||||
});
|
||||
};
|
||||
|
||||
export const mockCommentOne = new CommentModel({
|
||||
id: 1,
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
||||
import { EcmUserService } from '../services';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { CommentsComponent } from './comments.component';
|
||||
import { CommentsModule } from './comments.module';
|
||||
@@ -31,7 +30,7 @@ export default {
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, CommentsModule],
|
||||
providers: [
|
||||
{ provide: EcmUserService, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } },
|
||||
{ provide: CommentsServiceStoriesMock, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } },
|
||||
{ provide: ADF_COMMENTS_SERVICE, useClass: CommentsServiceStoriesMock }
|
||||
]
|
||||
})
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel, EcmUserModel } from '../../models';
|
||||
import { CommentModel, User } from '../../models';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { CommentsService } from '../interfaces';
|
||||
|
||||
@@ -57,7 +57,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as User,
|
||||
isSelected: false
|
||||
} as CommentModel,
|
||||
{
|
||||
@@ -84,7 +84,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as User,
|
||||
isSelected: false
|
||||
} as CommentModel,
|
||||
{
|
||||
@@ -111,7 +111,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as User,
|
||||
isSelected: false
|
||||
} as CommentModel
|
||||
]),
|
||||
@@ -139,7 +139,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as User,
|
||||
isSelected: false
|
||||
} as CommentModel)
|
||||
};
|
||||
|
@@ -15,10 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel, EcmUserModel } from '../../models';
|
||||
import { CommentModel } from '../../models';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { CommentsService } from '../interfaces';
|
||||
import { testUser } from './comments.stories.mock';
|
||||
import { UserLike } from '../../pipes/user-like.interface';
|
||||
|
||||
export class CommentsServiceStoriesMock implements Partial<CommentsService> {
|
||||
|
||||
@@ -58,7 +59,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as UserLike,
|
||||
isSelected: false
|
||||
} as CommentModel,
|
||||
{
|
||||
@@ -85,7 +86,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as UserLike,
|
||||
isSelected: false
|
||||
} as CommentModel,
|
||||
{
|
||||
@@ -112,7 +113,7 @@ export const commentsResponseMock = {
|
||||
id: 'hruser',
|
||||
email: 'test',
|
||||
isAdmin: () => false
|
||||
} as EcmUserModel,
|
||||
} as UserLike,
|
||||
isSelected: false
|
||||
} as CommentModel
|
||||
]),
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommentModel, EcmCompanyModel, EcmUserModel } from '../../models';
|
||||
import { CommentModel } from '../../models';
|
||||
|
||||
const fakeCompany: EcmCompanyModel = {
|
||||
const fakeCompany: any = {
|
||||
organization: '',
|
||||
address1: '',
|
||||
address2: '',
|
||||
@@ -30,7 +30,7 @@ const fakeCompany: EcmCompanyModel = {
|
||||
|
||||
export const getDateXMinutesAgo = (minutes: number) => new Date(new Date().getTime() - minutes * 60000);
|
||||
|
||||
const johnDoe: EcmUserModel = {
|
||||
const johnDoe: any = {
|
||||
id: '1',
|
||||
email: 'john.doe@alfresco.com',
|
||||
firstName: 'John',
|
||||
@@ -41,7 +41,7 @@ const johnDoe: EcmUserModel = {
|
||||
avatarId: '001'
|
||||
};
|
||||
|
||||
const janeEod: EcmUserModel = {
|
||||
const janeEod: any = {
|
||||
id: '2',
|
||||
email: 'jane.eod@alfresco.com',
|
||||
firstName: 'Jane',
|
||||
@@ -51,7 +51,7 @@ const janeEod: EcmUserModel = {
|
||||
isAdmin: undefined
|
||||
};
|
||||
|
||||
const robertSmith: EcmUserModel = {
|
||||
const robertSmith: any = {
|
||||
id: '3',
|
||||
email: 'robert.smith@alfresco.com',
|
||||
firstName: 'Robert',
|
||||
@@ -61,7 +61,7 @@ const robertSmith: EcmUserModel = {
|
||||
isAdmin: undefined
|
||||
};
|
||||
|
||||
export const testUser: EcmUserModel = {
|
||||
export const testUser: any = {
|
||||
id: '44',
|
||||
email: 'test.user@hyland.com',
|
||||
firstName: 'Test',
|
||||
|
Reference in New Issue
Block a user