diff --git a/frontend/src/css/draft.css b/frontend/src/css/draft.css index aa9499fcca..9ff939d12c 100644 --- a/frontend/src/css/draft.css +++ b/frontend/src/css/draft.css @@ -108,6 +108,9 @@ word-wrap: break-word; word-break: normal; } +.dirent-table-container td a:hover { + text-decoration: underline; +} .review-side-panel-item { border-bottom: 1px solid #e6e6dd; padding: 1em 0; diff --git a/frontend/src/draft.js b/frontend/src/draft.js index 185858c5fd..8953569b18 100644 --- a/frontend/src/draft.js +++ b/frontend/src/draft.js @@ -5,7 +5,7 @@ import { Button } from 'reactstrap'; /* eslint-disable */ import Prism from 'prismjs'; /* eslint-enable */ -import { siteRoot, gettext, draftOriginFilePath, draftFilePath, author, authorAvatar, originFileExists, draftFileExists, draftID, draftFileName, draftRepoID, draftStatus, draftPublishVersion, originFileVersion, filePermission } from './utils/constants'; +import { siteRoot, gettext, draftOriginFilePath, draftFilePath, author, authorAvatar, originFileExists, draftFileExists, draftID, draftFileName, draftRepoID, draftStatus, draftPublishVersion, originFileVersion, filePermission, serviceURL } from './utils/constants'; import { seafileAPI } from './utils/seafile-api'; import axios from 'axios'; import DiffViewer from '@seafile/seafile-editor/dist/viewer/diff-viewer'; @@ -56,7 +56,7 @@ class Draft extends React.Component { reviewers: [], inResizing: false, rightPartWidth: 30, - draftStatus: window.draft.config.draftStatus, + draftStatus: draftStatus, }; this.quote = ''; this.newIndex = null; @@ -731,7 +731,7 @@ class Draft extends React.Component { } render() { - const { draftInfo, reviewers, originRepoName } = this.state; + const { draftInfo, reviewers, originRepoName, draftStatus } = this.state; const onResizeMove = this.state.inResizing ? this.onResizeMouseMove : null; const draftLink = siteRoot + 'lib/' + draftRepoID + '/file' + draftFilePath + '?mode=edit'; const showPublishedButton = this.state.draftStatus == 'published'; @@ -807,7 +807,7 @@ class Draft extends React.Component { changedNumber={this.state.changedNodes.length} scrollToChangedNode={this.scrollToChangedNode}/> } - + @@ -917,6 +917,8 @@ class SidePanelOrigin extends React.Component { } render() { + const { draftStatus, originRepoName } = this.props; + const filePath = serviceURL + '/lib/' + draftRepoID + '/file' + draftOriginFilePath; return (
@@ -924,7 +926,15 @@ class SidePanelOrigin extends React.Component { - + + + +
{gettext('Location')}{this.props.originRepoName}{draftFilePath}
{gettext('Location')} + {draftStatus === 'open' ? + {originRepoName}{draftFilePath} : + {filePath} + } +
@@ -933,7 +943,8 @@ class SidePanelOrigin extends React.Component { } const SidePanelOriginPropTypes = { - originRepoName: PropTypes.string.isRequired + originRepoName: PropTypes.string.isRequired, + draftStatus: PropTypes.string.isRequired, }; SidePanelOrigin.propTypes = SidePanelOriginPropTypes; diff --git a/frontend/src/pages/drafts/draft-content.js b/frontend/src/pages/drafts/draft-content.js index 6ef09cefed..286d0efa4c 100644 --- a/frontend/src/pages/drafts/draft-content.js +++ b/frontend/src/pages/drafts/draft-content.js @@ -60,7 +60,7 @@ class DraftContent extends React.Component { {this.props.draftList.length === 0 && (

{gettext('No draft yet')}

-

{gettext('Draft is a way to let you collaborate with others on files. You can create a draft from a file, edit the draft and then ask for a review. The original file will be updated only after the draft be reviewed.')}

+

{gettext('Draft is a way to let you collaborate with others on files. You can create a draft from a file, edit the draft and then ask for a review. The original file will be updated only after the draft has been reviewed.')}

)} {this.props.draftList.length !==0 && (