mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10252] Storybook Update existing Stories to adhere to conventions (#7780)
* [AAE-10252] Storybook Update existing Stories to adhere to conventions * Added expaned controls globally * About Module, Comments Module * Icon Module, Language Menu Module * Social Module * Naming of single stories * process-services-cloud Modules * Added descriptions and categories for actions * Fixed and cleaned error-content stories * Updated playwright tests to navigate properly * Template Module * Toolbar Module * fixed Like component controls * content projection showcase
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { CommentModel } from '../models/comment.model';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { CommentListComponent } from './comment-list.component';
|
||||
import { CommentsModule } from './comments.module';
|
||||
@@ -37,20 +35,22 @@ export default {
|
||||
],
|
||||
argTypes: {
|
||||
comments: {
|
||||
type: CommentModel,
|
||||
control: 'object',
|
||||
description: 'CommentModel array',
|
||||
table: {
|
||||
type: { summary: 'CommentModel' }
|
||||
type: { summary: 'CommentModel[]' }
|
||||
}
|
||||
},
|
||||
clickRow: {
|
||||
action: 'clickRow',
|
||||
description: 'Emitted when the user clicks on one of the comment rows.',
|
||||
table: { category: 'Actions' }
|
||||
}
|
||||
}
|
||||
} as Meta;
|
||||
|
||||
const template: Story<CommentListComponent> = (args: CommentListComponent) => ({
|
||||
props: {
|
||||
...args,
|
||||
clickRow: action('clickRow')
|
||||
}
|
||||
props: args
|
||||
});
|
||||
|
||||
export const taskBased = template.bind({});
|
||||
|
@@ -20,7 +20,6 @@ import { CommentContentService, CommentProcessService, EcmUserService } from '..
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { CommentsComponent } from './comments.component';
|
||||
import { CommentsModule } from './comments.module';
|
||||
import { CommentModel } from '../models/comment.model';
|
||||
import { CommentContentServiceMock } from '../mock/comment-content-service.mock';
|
||||
import { CommentProcessServiceMock } from '../mock/comment-process-service.mock';
|
||||
import { commentsTaskData, commentsNodeData } from '../mock/comment-content.mock';
|
||||
@@ -40,9 +39,9 @@ export default {
|
||||
],
|
||||
argTypes: {
|
||||
comments: {
|
||||
type: CommentModel,
|
||||
control: 'object',
|
||||
description: 'CommentModel array',
|
||||
table: { type: { summary: 'CommentModel' } }
|
||||
table: { type: { summary: 'CommentModel[]' } }
|
||||
},
|
||||
readOnly: {
|
||||
control: 'boolean',
|
||||
@@ -50,28 +49,29 @@ export default {
|
||||
defaultValue: false,
|
||||
table: {
|
||||
type: { summary: 'boolean' },
|
||||
defaultValue: { summary: 'false'}
|
||||
defaultValue: { summary: 'false' }
|
||||
}
|
||||
},
|
||||
nodeId: {
|
||||
control: 'text',
|
||||
description: 'Necessary in order to add a new Node comment',
|
||||
defaultValue: undefined,
|
||||
table: {
|
||||
type: { summary: 'string' },
|
||||
defaultValue: { summary: 'undefined' }
|
||||
type: { summary: 'string' }
|
||||
},
|
||||
if: { arg: 'taskId', exists: false }
|
||||
},
|
||||
taskId: {
|
||||
control: 'text',
|
||||
description: 'Necessary in order to add a new Task comment',
|
||||
defaultValue: undefined,
|
||||
table: {
|
||||
type: { summary: 'string' },
|
||||
defaultValue: { summary: 'undefined' }
|
||||
type: { summary: 'string' }
|
||||
},
|
||||
if: { arg: 'nodeId', exists: false }
|
||||
},
|
||||
error: {
|
||||
action: 'error',
|
||||
description: 'Emitted when an error occurs while displaying/adding a comment.',
|
||||
table: { category: 'Actions' }
|
||||
}
|
||||
}
|
||||
} as Meta;
|
||||
|
Reference in New Issue
Block a user