Merge pull request #6363 from artoscinote/ma_SCI_9410

Fix attachment issues [SCI-9410]
This commit is contained in:
Martin Artnik 2023-10-05 16:42:10 +02:00 committed by GitHub
commit 19c44c50ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 29 additions and 5 deletions

View file

@ -201,6 +201,8 @@ var MarvinJsEditorApi = (function() {
}
$(marvinJsModal).modal('hide');
config.button.dataset.inProgress = false;
if (MarvinJsEditor.saveCallback) MarvinJsEditor.saveCallback();
},
error: function(response) {
if (response.status === 403) {
@ -295,6 +297,7 @@ $(document).on('click', '.marvinjs-edit-button', function() {
var editButton = $(this);
$.post(editButton.data('sketch-start-edit-url'));
$('#filePreviewModal').modal('hide');
MarvinJsEditor.open({
mode: 'edit',
data: editButton.data('sketch-description'),

View file

@ -36,6 +36,12 @@
text-align: center;
width: calc(100% - 4rem);
&.file-preview-container__wopi {
height: 100%;
margin: 0;
width: 100%;
}
.asset-image {
background-color: var(--sn-white);
}

View file

@ -32,6 +32,7 @@
@attachment:viewMode="updateAttachmentViewMode"
@attachment:delete="deleteAttachment(attachment.id)"
@attachment:moved="attachmentMoved"
@attachment:uploaded="$emit('attachment:uploaded')"
/>
</div>
</div>

View file

@ -154,7 +154,14 @@
openOVEditor(url) {
window.showIFrameModal(url);
},
reloadAttachments() {
this.$emit('attachment:uploaded');
},
openMarvinJsEditor() {
MarvinJsEditor.initNewButton(
this.$refs.marvinjsEditButton,
this.reloadAttachments
);
$(this.$refs.marvinjsEditButton).trigger('click');
},
openScinoteEditor() {

View file

@ -33,6 +33,7 @@
@attachment:viewMode="updateViewMode"
@attachment:delete="deleteAttachment"
@attachment:moved="attachmentMoved"
@attachment:uploaded="reloadAttachments"
/>
</div>
<template v-if="attachment.attributes.wopi">

View file

@ -33,6 +33,7 @@
@attachment:viewMode="updateViewMode"
@attachment:delete="deleteAttachment"
@attachment:moved="attachmentMoved"
@attachment:uploaded="reloadAttachments"
/>
</div>
</template>

View file

@ -18,6 +18,9 @@ export default {
HelperModule.flashAlertMsg(this.i18n.t('general.no_permissions'), 'danger');
}
});
},
reloadAttachments() {
this.$emit('attachment:uploaded');
}
}
};

View file

@ -48,6 +48,7 @@
:href="attachment.attributes.urls.edit_asset"
id="wopi_file_edit_button"
:class="attachment.attributes.wopi_context.edit_supported ? '' : 'disabled'"
target="_blank"
>
<i class="sn-icon sn-icon-edit"></i>
</a>
@ -102,6 +103,7 @@
@attachment:viewMode="updateViewMode"
@attachment:delete="deleteAttachment"
@attachment:moved="attachmentMoved"
@attachment:uploaded="reloadAttachments"
:withBorder="true"
/>
<deleteAttachmentModal

View file

@ -32,9 +32,7 @@ export default {
this.uploadFiles(this.$refs.fileSelector.files);
},
openMarvinJsModal(button) {
MarvinJsEditor.initNewButton('.new-marvinjs-upload-button', () => {
this.loadAttachments
});
MarvinJsEditor.initNewButton('.new-marvinjs-upload-button', this.loadAttachments);
button.click();
},
openWopiFileModal() {

View file

@ -1,4 +1,6 @@
export default function isInViewPort(el) {
if (!el) return;
const rect = el.getBoundingClientRect();
return (

View file

@ -19,7 +19,7 @@
<span v-for="(item, i) in listItems" :key="i" class="contents">
<div v-if="item.dividerBefore" class="border-0 border-t border-solid border-sn-light-grey"></div>
<a :href="item.url" v-if="!item.submenu"
:traget="item.url_target || '_self'"
:target="item.url_target || '_self'"
:class="{ 'bg-sn-super-light-blue': item.active }"
:data-toggle="item.modalTarget && 'modal'"
:data-target="item.modalTarget"

View file

@ -54,7 +54,7 @@
</div>
</div>
<div class="modal-body">
<div class="file-preview-container">
<div class="file-preview-container <%= 'file-preview-container__wopi' if wopi_file?(asset) %>">
<% if asset.previewable? %>
<% if wopi_enabled? && wopi_file?(asset) %>
<iframe class="wopi-file-preview" src="<%= asset.get_action_url(current_user, 'embedview') %>"></iframe>