mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
sdoc-draft (#5512)
* sdoc-draft * seadoc_mask_as_draft * SeadocDraft * doc_uuid delete
This commit is contained in:
@@ -16,6 +16,8 @@ const TextTranslation = {
|
||||
'OPEN_VIA_CLIENT' : {key : 'Open via Client', value : gettext('Open via Client')},
|
||||
'LOCK' : {key : 'Lock', value : gettext('Lock')},
|
||||
'UNLOCK' : {key : 'Unlock', value : gettext('Unlock')},
|
||||
'MASK_AS_DRAFT' : {key : 'Mask as draft', value : gettext('Mask as draft')},
|
||||
'UNMASK_AS_DRAFT' : {key : 'Unmask as draft', value : gettext('Unmask as draft')},
|
||||
'COMMENT' : {key : 'Comment', value : gettext('Comment')},
|
||||
'HISTORY' : {key : 'History', value : gettext('History')},
|
||||
'ACCESS_LOG' : {key : 'Access Log', value : gettext('Access Log')},
|
||||
|
@@ -526,7 +526,7 @@ export const Utils = {
|
||||
|
||||
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
|
||||
let list = [];
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK,
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK, MASK_AS_DRAFT, UNMASK_AS_DRAFT,
|
||||
COMMENT, HISTORY, ACCESS_LOG, OPEN_VIA_CLIENT, ONLYOFFICE_CONVERT } = TextTranslation;
|
||||
const permission = dirent.permission;
|
||||
const { isCustomPermission, customPermission } = Utils.getUserPermission(permission);
|
||||
@@ -594,6 +594,13 @@ export const Utils = {
|
||||
}
|
||||
|
||||
list.push('Divider');
|
||||
if (Utils.isSdocFile(dirent.name)) {
|
||||
if (dirent.is_sdoc_draft) {
|
||||
list.push(UNMASK_AS_DRAFT);
|
||||
} else {
|
||||
list.push(MASK_AS_DRAFT);
|
||||
}
|
||||
}
|
||||
if (enableFileComment) {
|
||||
list.push(COMMENT);
|
||||
}
|
||||
@@ -804,6 +811,20 @@ export const Utils = {
|
||||
}
|
||||
},
|
||||
|
||||
isSdocFile: function(filePath) {
|
||||
let index = filePath.lastIndexOf('.');
|
||||
if (index === -1) {
|
||||
return false;
|
||||
} else {
|
||||
let type = filePath.substring(index).toLowerCase();
|
||||
if (type === '.sdoc') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
isInternalFileLink: function(url, repoID) {
|
||||
var re = new RegExp(serviceURL + '/lib/' + repoID + '/file.*');
|
||||
return re.test(url);
|
||||
|
Reference in New Issue
Block a user