mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 02:37:44 +02:00
UBERF-6486 Lock document content (#5799)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -96,6 +96,10 @@ export class TDocument extends TAttachedDoc implements Document {
|
||||
@Hidden()
|
||||
content!: CollaborativeDoc
|
||||
|
||||
@Prop(TypeRef(core.class.Account), document.string.LockedBy)
|
||||
@Hidden()
|
||||
lockedBy?: Ref<Account>
|
||||
|
||||
@Prop(Collection(document.class.Document), document.string.ChildDocument)
|
||||
children!: CollectionSize<Document>
|
||||
|
||||
@@ -373,6 +377,44 @@ function defineDocument (builder: Builder): void {
|
||||
document.action.CopyDocumentLink
|
||||
)
|
||||
|
||||
createAction(
|
||||
builder,
|
||||
{
|
||||
action: document.actionImpl.LockContent,
|
||||
label: document.string.Lock,
|
||||
icon: document.icon.Lock,
|
||||
input: 'focus',
|
||||
category: document.category.Document,
|
||||
target: document.class.Document,
|
||||
context: {
|
||||
mode: ['context', 'browser'],
|
||||
application: document.app.Documents,
|
||||
group: 'copy'
|
||||
},
|
||||
visibilityTester: document.function.CanLockDocument
|
||||
},
|
||||
document.action.LockContent
|
||||
)
|
||||
|
||||
createAction(
|
||||
builder,
|
||||
{
|
||||
action: document.actionImpl.UnlockContent,
|
||||
label: document.string.Unlock,
|
||||
icon: document.icon.Unlock,
|
||||
input: 'focus',
|
||||
category: document.category.Document,
|
||||
target: document.class.Document,
|
||||
context: {
|
||||
mode: ['context', 'browser'],
|
||||
application: document.app.Documents,
|
||||
group: 'copy'
|
||||
},
|
||||
visibilityTester: document.function.CanUnlockDocument
|
||||
},
|
||||
document.action.UnlockContent
|
||||
)
|
||||
|
||||
// Notifications
|
||||
|
||||
builder.mixin(document.class.Document, core.class.Class, activity.mixin.ActivityDoc, {})
|
||||
|
||||
@@ -40,10 +40,18 @@ export default mergeIds(documentId, document, {
|
||||
actionImpl: {
|
||||
CreateChildDocument: '' as ViewAction,
|
||||
CreateDocument: '' as ViewAction,
|
||||
EditTeamspace: '' as ViewAction
|
||||
EditTeamspace: '' as ViewAction,
|
||||
LockContent: '' as ViewAction,
|
||||
UnlockContent: '' as ViewAction
|
||||
},
|
||||
action: {
|
||||
PublicLink: '' as Ref<Action<Doc, any>>
|
||||
PublicLink: '' as Ref<Action<Doc, any>>,
|
||||
LockContent: '' as Ref<Action<Doc, any>>,
|
||||
UnlockContent: '' as Ref<Action<Doc, any>>
|
||||
},
|
||||
function: {
|
||||
CanLockDocument: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,
|
||||
CanUnlockDocument: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>
|
||||
},
|
||||
viewlet: {
|
||||
TeamspaceTable: '' as Ref<Viewlet>
|
||||
@@ -55,6 +63,7 @@ export default mergeIds(documentId, document, {
|
||||
string: {
|
||||
ConfigDescription: '' as IntlString,
|
||||
ParentDocument: '' as IntlString,
|
||||
ChildDocument: '' as IntlString
|
||||
ChildDocument: '' as IntlString,
|
||||
LockedBy: '' as IntlString
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user