1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

sdoc-draft (#5512)

* sdoc-draft

* seadoc_mask_as_draft

* SeadocDraft

* doc_uuid delete
This commit is contained in:
欢乐马
2023-06-20 21:18:07 +08:00
committed by GitHub
parent 71be15476c
commit 643b282b34
11 changed files with 235 additions and 5 deletions

View File

@@ -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);