mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
unfreeze sdoc (#6016)
This commit is contained in:
@@ -154,6 +154,9 @@ class DirentGridView extends React.Component {
|
||||
case 'Copy':
|
||||
this.onItemCopyToggle();
|
||||
break;
|
||||
case 'Unfreeze Document':
|
||||
this.onUnlockItem(currentObject);
|
||||
break;
|
||||
case 'Freeze Document':
|
||||
this.onFreezeDocument(currentObject);
|
||||
break;
|
||||
|
@@ -280,6 +280,9 @@ class DirentListItem extends React.Component {
|
||||
case 'Lock':
|
||||
this.onLockItem();
|
||||
break;
|
||||
case 'Unfreeze Document':
|
||||
this.onUnlockItem();
|
||||
break;
|
||||
case 'Freeze Document':
|
||||
this.onFreezeDocument();
|
||||
break;
|
||||
|
@@ -21,8 +21,9 @@ const TextTranslation = {
|
||||
'DETAILS' : {key : 'Details', value : gettext('Details')},
|
||||
'OPEN_VIA_CLIENT' : {key : 'Open via Client', value : gettext('Open via Client')},
|
||||
'LOCK' : {key : 'Lock', value : gettext('Lock')},
|
||||
'FREEZE_DOCUMENT' : {key : 'Freeze Document', value : gettext('Freeze Document')},
|
||||
'UNLOCK' : {key : 'Unlock', value : gettext('Unlock')},
|
||||
'FREEZE_DOCUMENT' : {key : 'Freeze Document', value : gettext('Freeze Document')},
|
||||
'UNFREEZE_DOCUMENT' : {key : 'Unfreeze Document', value : gettext('Unfreeze Document')},
|
||||
'CONVERT_TO_MARKDOWN' : {key : 'Convert to Markdown', value : gettext('Convert to Markdown')},
|
||||
'CONVERT_TO_SDOC' : {key : 'Convert to sdoc', value : gettext('Convert to sdoc')},
|
||||
'CONVERT_TO_DOCX' : {key : 'Convert to docx', value : gettext('Convert to docx')},
|
||||
|
@@ -530,7 +530,7 @@ export const Utils = {
|
||||
|
||||
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
|
||||
let list = [];
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK, FREEZE_DOCUMENT,
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK, UNFREEZE_DOCUMENT, FREEZE_DOCUMENT,
|
||||
HISTORY, ACCESS_LOG, PROPERTIES, OPEN_VIA_CLIENT, ONLYOFFICE_CONVERT, CONVERT_TO_MARKDOWN, CONVERT_TO_DOCX, EXPORT_DOCX, CONVERT_TO_SDOC } = TextTranslation;
|
||||
const permission = dirent.permission;
|
||||
const { isCustomPermission, customPermission } = Utils.getUserPermission(permission);
|
||||
@@ -590,8 +590,10 @@ export const Utils = {
|
||||
if (isPro) {
|
||||
if (dirent.is_locked) {
|
||||
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice' || isRepoOwner || currentRepoInfo.is_admin) {
|
||||
if (!dirent.name.endsWith('.sdoc')) {
|
||||
list.push(UNLOCK);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!dirent.name.endsWith('.sdoc')) {
|
||||
list.push(LOCK);
|
||||
@@ -604,6 +606,9 @@ export const Utils = {
|
||||
if (isPro && !dirent.is_locked && dirent.name.endsWith('.sdoc')) {
|
||||
list.push(FREEZE_DOCUMENT);
|
||||
}
|
||||
if (isPro && dirent.is_locked && dirent.name.endsWith('.sdoc')) {
|
||||
list.push(UNFREEZE_DOCUMENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user