Commit 20cce5fc authored by 2458773093's avatar 2458773093

show edit indicator on detail page

parent 498630f2
...@@ -33,12 +33,17 @@ export default class DetailedStatus extends ImmutablePureComponent { ...@@ -33,12 +33,17 @@ export default class DetailedStatus extends ImmutablePureComponent {
compact: PropTypes.bool, compact: PropTypes.bool,
showMedia: PropTypes.bool, showMedia: PropTypes.bool,
onToggleMediaVisibility: PropTypes.func, onToggleMediaVisibility: PropTypes.func,
onShowRevisions: PropTypes.func,
}; };
state = { state = {
height: null, height: null,
}; };
handleShowRevisions = () => {
this.props.onShowRevisions(this.props.status);
}
handleOpenVideo = (media, startTime) => { handleOpenVideo = (media, startTime) => {
this.props.onOpenVideo(media, startTime); this.props.onOpenVideo(media, startTime);
} }
...@@ -187,11 +192,12 @@ export default class DetailedStatus extends ImmutablePureComponent { ...@@ -187,11 +192,12 @@ export default class DetailedStatus extends ImmutablePureComponent {
<DisplayName account={status.get('account')} localDomain={this.props.domain} /> <DisplayName account={status.get('account')} localDomain={this.props.domain} />
</NavLink> </NavLink>
{status.get('group') && ( {(status.get('group') || status.get('revised_at') !== null) && (
<div className='status__meta'> <div className='status__meta'>
Posted in <NavLink to={`/groups/${status.getIn(['group', 'id'])}`}>{status.getIn(['group', 'title'])}</NavLink> {status.get('group') && <React.Fragment>Posted in <NavLink to={`/groups/${status.getIn(['group', 'id'])}`}>{status.getIn(['group', 'title'])}</NavLink></React.Fragment>}
</div> {status.get('revised_at') !== null && <a onClick={this.handleShowRevisions}> Edited</a>}
)} </div>
)}
<StatusContent status={status} expanded={!status.get('hidden')} onExpandedToggle={this.handleExpandedToggle} /> <StatusContent status={status} expanded={!status.get('hidden')} onExpandedToggle={this.handleExpandedToggle} />
......
...@@ -175,6 +175,10 @@ class Status extends ImmutablePureComponent { ...@@ -175,6 +175,10 @@ class Status extends ImmutablePureComponent {
} }
} }
handleShowRevisions = (status) => {
this.props.dispatch(openModal('STATUS_REVISION', { status }));
}
handleReplyClick = (status) => { handleReplyClick = (status) => {
let { askReplyConfirmation, dispatch, intl } = this.props; let { askReplyConfirmation, dispatch, intl } = this.props;
if (askReplyConfirmation) { if (askReplyConfirmation) {
...@@ -504,6 +508,7 @@ class Status extends ImmutablePureComponent { ...@@ -504,6 +508,7 @@ class Status extends ImmutablePureComponent {
domain={domain} domain={domain}
showMedia={this.state.showMedia} showMedia={this.state.showMedia}
onToggleMediaVisibility={this.handleToggleMediaVisibility} onToggleMediaVisibility={this.handleToggleMediaVisibility}
onShowRevisions={this.handleShowRevisions}
/> />
<ActionBar <ActionBar
......
...@@ -47,12 +47,7 @@ class EditStatusService < BaseService ...@@ -47,12 +47,7 @@ class EditStatusService < BaseService
end end
def process_status! def process_status!
# The following transaction block is needed to wrap the UPDATEs to @status.update!(status_attributes)
# the media attachments when the status is created
ApplicationRecord.transaction do
@status.update!(status_attributes)
end
process_hashtags_service.call(@status) process_hashtags_service.call(@status)
process_mentions_service.call(@status) process_mentions_service.call(@status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment