Merge pull request #7354 from wandji20/wb-SCI-9901

Improve logic for showing disabled edit button in unsupported wopi file previews [SCI-9901]
This commit is contained in:
ajugo 2024-03-26 10:16:46 +01:00 committed by GitHub
commit 4beb3fae96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,15 +1,15 @@
<template>
<div class="sn-open-locally-menu" @mouseenter="fetchLocalAppInfo">
<div v-if="!canOpenLocally && (attachment.attributes.wopi && attachment.attributes.urls.edit_asset)">
<a v-if="editWopiEnabled" :href="`${attachment.attributes.urls.edit_asset}`" target="_blank"
<button class="btn btn-light" v-if="!editWopiSupported" style="pointer-events: all;"
:title="attachment.attributes.wopi_context.title" disabled="true">
{{ attachment.attributes.wopi_context.button_text }}
</button>
<div v-else-if="!canOpenLocally && (attachment.attributes.wopi && attachment.attributes.urls.edit_asset)">
<a :href="`${attachment.attributes.urls.edit_asset}`" target="_blank"
class="block whitespace-nowrap rounded px-3 py-2.5
hover:!text-sn-blue hover:no-underline cursor-pointer hover:bg-sn-super-light-grey">
{{ attachment.attributes.wopi_context.button_text }}
</a>
<button class="btn btn-light" v-else style="pointer-events: all;"
:title="attachment.attributes.wopi_context.title" disabled="true">
{{ attachment.attributes.wopi_context.button_text }}
</button>
</div>
<div v-else-if="!usesWebIntegration">
<MenuDropdown
@ -104,7 +104,7 @@ export default {
return this.attachment.attributes.asset_type === 'gene_sequence'
|| this.attachment.attributes.asset_type === 'marvinjs';
},
editWopiEnabled() {
editWopiSupported() {
return this.attachment.attributes.wopi_context.edit_supported;
}
},