mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
wip
This commit is contained in:
parent
17db964b10
commit
866b4eba8a
4 changed files with 661 additions and 662 deletions
|
@ -171,8 +171,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
|||
return
|
||||
}
|
||||
|
||||
//err = processPage(documentID, fileResult.PageFiles, fileResult.Pages.Children[0], 1, p)
|
||||
|
||||
for k, v := range fileResult.Pages {
|
||||
var p page.Page
|
||||
p.OrgID = ctx.OrgID
|
||||
|
@ -196,7 +194,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
|||
model.Meta = meta
|
||||
|
||||
err = store.Page.Add(ctx, model)
|
||||
|
||||
if err != nil {
|
||||
ctx.Transaction.Rollback()
|
||||
err = errors.Wrap(err, "cannot insert new page for new document")
|
||||
|
@ -216,7 +213,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
|||
a.RefID = refID
|
||||
|
||||
err = store.Attachment.Add(ctx, a)
|
||||
|
||||
if err != nil {
|
||||
ctx.Transaction.Rollback()
|
||||
err = errors.Wrap(err, "cannot insert attachment for new document")
|
||||
|
@ -224,7 +220,17 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
|||
}
|
||||
}
|
||||
|
||||
ctx.Transaction.Commit()
|
||||
store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||
LabelID: newDocument.LabelID,
|
||||
SourceID: newDocument.RefID,
|
||||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeCreated})
|
||||
|
||||
err = ctx.Transaction.Commit()
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "cannot commit new document import")
|
||||
return
|
||||
}
|
||||
|
||||
newDocument, err = store.Document.Get(ctx, documentID)
|
||||
if err != nil {
|
||||
|
@ -233,19 +239,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
|||
return
|
||||
}
|
||||
|
||||
// err = store.Document.Update(ctx, newDocument) // TODO review - this seems to write-back an unaltered record from that read above, but within that it calls searches.UpdateDocument() to reindex the doc.
|
||||
// if err != nil {
|
||||
// ctx.Transaction.Rollback()
|
||||
// err = errors.Wrap(err, "cannot updater new document")
|
||||
// return
|
||||
// }
|
||||
|
||||
store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||
LabelID: newDocument.LabelID,
|
||||
SourceID: newDocument.RefID,
|
||||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeCreated})
|
||||
|
||||
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
|
||||
|
||||
return
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -23,6 +23,10 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
|
|||
hasProtectedFolders: false,
|
||||
hasPrivateFolders: false,
|
||||
newFolder: '',
|
||||
copyTemplate: true,
|
||||
copyBlock: true,
|
||||
copyPermission: true,
|
||||
copyDocument: false,
|
||||
|
||||
didReceiveAttrs() {
|
||||
let folders = this.get('folders');
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
<div class="sidebar-panel">
|
||||
<div class="space-tools">
|
||||
{{#if showingDocument}}
|
||||
{{folder/start-document savedTemplates=savedTemplates folder=folder editor=folderService.canEditCurrentFolder
|
||||
onImport=(action 'onImport')
|
||||
onEditTemplate=(action 'onEditTemplate')
|
||||
onDocumentTemplate=(action 'onDocumentTemplate')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="folders-list">
|
||||
{{#if session.isEditor}}
|
||||
<div class="comment-box document-sidebar-form-wrapper">
|
||||
<div class="input-control">
|
||||
<label>New space</label>
|
||||
<div class="tip">A place for related documents</div>
|
||||
{{input type='text' id="new-folder-name" class="mousetrap" value=newFolder}}
|
||||
<p>Copy existing space</p>
|
||||
{{#ui/ui-checkbox selected=copyTemplate}}Templates{{/ui/ui-checkbox}}
|
||||
{{#ui/ui-checkbox selected=copyBlock}}Reusable content{{/ui/ui-checkbox}}
|
||||
{{#ui/ui-checkbox selected=copyPermission}}Permissions{{/ui/ui-checkbox}}
|
||||
{{#ui/ui-checkbox selected=copyDocument}}Documents{{/ui/ui-checkbox}}
|
||||
</div>
|
||||
<div class="regular-button button-blue">Add</div>
|
||||
</div>
|
||||
|
||||
<div id="add-space-button" class="regular-button button-white">
|
||||
<i class="material-icons">add</i>
|
||||
<div class="name">Space</div>
|
||||
|
@ -17,9 +22,6 @@
|
|||
{{#dropdown-dialog target="add-space-button" position="bottom left" button="Add" color="flat-green" onAction=(action 'addFolder') focusOn="new-folder-name" }}
|
||||
<div>
|
||||
<div class="input-control">
|
||||
<label>New space</label>
|
||||
<div class="tip">A repository for related documentation</div>
|
||||
{{input type='text' id="new-folder-name" class="mousetrap" value=newFolder}}
|
||||
</div>
|
||||
</div>
|
||||
{{/dropdown-dialog}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue