From 31afebad00c59d82803989a7e1edb6ee44569d50 Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 13 Apr 2022 10:59:24 +0800 Subject: [PATCH 1/2] [file 'history versions'] added 'view snapshot' for items --- frontend/src/pages/file-history-old/history-item.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/file-history-old/history-item.js b/frontend/src/pages/file-history-old/history-item.js index 930a0f1232..9f7488a58f 100644 --- a/frontend/src/pages/file-history-old/history-item.js +++ b/frontend/src/pages/file-history-old/history-item.js @@ -48,6 +48,7 @@ class HistoryItem extends React.Component { let userProfileURL = `${siteRoot}profile/${encodeURIComponent(item.creator_email)}/`; let viewUrl = `${siteRoot}repo/${historyRepoID}/history/files/?obj_id=${item.rev_file_id}&commit_id=${item.commit_id}&p=${Utils.encodePath(filePath)}`; let diffUrl = `${siteRoot}repo/text_diff/${historyRepoID}/?commit=${item.commit_id}&p=${Utils.encodePath(filePath)}`; + const snapshotURL = `${siteRoot}repo/${historyRepoID}/snapshot/?commit_id=${item.commit_id}`; return ( @@ -67,6 +68,7 @@ class HistoryItem extends React.Component { downloadUrl={downloadUrl} viewUrl={viewUrl} diffUrl={diffUrl} + snapshotURL={snapshotURL} onItemRestore={this.onItemRestore} canDownload={this.props.canDownload} canCompare={this.props.canCompare} @@ -106,7 +108,7 @@ class MoreMenu extends React.PureComponent { } render() { - const { index, downloadUrl, viewUrl, diffUrl, onItemRestore, canCompare, canDownload } = this.props; + const { index, downloadUrl, viewUrl, diffUrl, snapshotURL, onItemRestore, canCompare, canDownload } = this.props; return ( {gettext('Download')}} {gettext('View')} {/*canCompare && {gettext('Diff')}*/} + {index != 0 && {gettext('View Snapshot')}} ); From 1e4a3933de7a15b8d575c245fb880c30692a1501 Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 13 Apr 2022 11:03:54 +0800 Subject: [PATCH 2/2] [file 'history versions'] updated the text for 'view snapshot' --- frontend/src/pages/file-history-old/history-item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/file-history-old/history-item.js b/frontend/src/pages/file-history-old/history-item.js index 9f7488a58f..be4e36ed4d 100644 --- a/frontend/src/pages/file-history-old/history-item.js +++ b/frontend/src/pages/file-history-old/history-item.js @@ -124,7 +124,7 @@ class MoreMenu extends React.PureComponent { {canDownload && {gettext('Download')}} {gettext('View')} {/*canCompare && {gettext('Diff')}*/} - {index != 0 && {gettext('View Snapshot')}} + {index != 0 && {gettext('View Related Snapshot')}} );