feat: display author of changes in workflow tab (#5780)

This commit is contained in:
pr0grammm
2021-10-18 17:08:38 +05:30
committed by GitHub
parent 9627452de0
commit 3f607e41d9
30 changed files with 288 additions and 233 deletions

View File

@ -882,6 +882,7 @@ export class Backend {
label: collection && selectFileEntryLabel(collection, slug),
mediaFiles,
updatedOn: entryData.updatedAt,
author: entryData.pullRequestAuthor,
status: entryData.status,
meta: { path: prepareMetaPath(path, collection) },
});

View File

@ -128,12 +128,14 @@ function WorkflowCard({
allowPublish,
canPublish,
onPublish,
postAuthor,
t,
}) {
return (
<WorkflowCardContainer>
<WorkflowLink to={editLink}>
<CardCollection>{collectionLabel}</CardCollection>
{postAuthor}
<CardTitle>{title}</CardTitle>
{(timestamp || authorLastChange) && <CardDate date={timestamp} author={authorLastChange} />}
<CardBody>{body}</CardBody>
@ -168,6 +170,7 @@ WorkflowCard.propTypes = {
allowPublish: PropTypes.bool.isRequired,
canPublish: PropTypes.bool.isRequired,
onPublish: PropTypes.func.isRequired,
postAuthor: PropTypes.string,
t: PropTypes.func.isRequired,
};

View File

@ -220,6 +220,7 @@ class WorkflowList extends React.Component {
const allowPublish = collection?.get('publish');
const canPublish = ownStatus === status.last() && !entry.get('isPersisting', false);
const postAuthor = entry.get('author');
return (
<DragSource
@ -244,6 +245,7 @@ class WorkflowList extends React.Component {
allowPublish={allowPublish}
canPublish={canPublish}
onPublish={this.requestPublish.bind(this, collectionName, slug, ownStatus)}
postAuthor={postAuthor}
/>
</div>,
)