Merge pull request #7679 from rekonder/aj_SCI_10783

Extend SciNote edit buttons component [SCI-10783]
This commit is contained in:
ajugo 2024-07-03 15:01:55 +02:00 committed by GitHub
commit 526ef396d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,11 +2,13 @@
<div class="buttons"> <div class="buttons">
<template v-if="isWindows"> <template v-if="isWindows">
<a :href="getWindowsHref" <a :href="getWindowsHref"
class="btn btn-primary new-project-btn" class="w-full btn btn-primary new-project-btn"
:title="i18n.t('users.settings.account.addons.desktop_app.windows_button')" :title="i18n.t('users.settings.account.addons.desktop_app.windows_button')"
role="button" role="button"
target="_blank"> target="_blank">
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.windows_button') }}</span> <span :class="{'hidden-xs' : !isCompact }">
{{ this.isCompact ? i18n.t('general.download') : i18n.t('users.settings.account.addons.desktop_app.windows_button') }}
</span>
</a> </a>
<div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);"> <div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
{{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[0]['version']}) }} {{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[0]['version']}) }}
@ -15,18 +17,20 @@
<template v-else-if="isMac"> <template v-else-if="isMac">
<a :href="getMacHref" <a :href="getMacHref"
class="btn btn-primary new-project-btn" class="w-full btn btn-primary new-project-btn"
:title="i18n.t('users.settings.account.addons.desktop_app.macos_button')" :title="i18n.t('users.settings.account.addons.desktop_app.macos_button')"
role="button" role="button"
target="_blank"> target="_blank">
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.macos_button') }}</span> <span :class="{'hidden-xs' : !isCompact }">
{{ this.isCompact ? i18n.t('general.download') : i18n.t('users.settings.account.addons.desktop_app.macos_button') }}
</span>
</a> </a>
<div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);"> <div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
{{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[1]['version']}) }} {{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[1]['version']}) }}
</div> </div>
</template> </template>
<template v-else> <template v-else-if="!isCompact">
<div class="flex"> <div class="flex">
<div> <div>
<a :href="getWindowsHref" <a :href="getWindowsHref"
@ -60,7 +64,7 @@
</div> </div>
</template> </template>
<a v-if="!isUpdateVersionModal" :href="'https://knowledgebase.scinote.net/en/knowledge/how-to-use-scinote-edit'" <a v-if="!isUpdateVersionModal && !isCompact" :href="'https://knowledgebase.scinote.net/en/knowledge/how-to-use-scinote-edit'"
:title="i18n.t('users.settings.account.addons.more_info')" :title="i18n.t('users.settings.account.addons.more_info')"
class="text-sn-blue" class="text-sn-blue"
target="_blank"> target="_blank">
@ -75,7 +79,8 @@ export default {
name: 'ScinoteEditDownload', name: 'ScinoteEditDownload',
props: { props: {
data: { type: String, required: true }, data: { type: String, required: true },
isUpdateVersionModal: { type: Boolean, required: false } isUpdateVersionModal: { type: Boolean, required: false },
isCompact: { type: Boolean, required: false, default: false }
}, },
data() { data() {
return { return {
@ -91,7 +96,7 @@ export default {
return /Mac OS/.test(this.userAgent); return /Mac OS/.test(this.userAgent);
}, },
showButtonLabel() { showButtonLabel() {
return this.responseData && this.responseData.length > 0 && !this.isUpdateVersionModal; return this.responseData && this.responseData.length > 0 && !this.isUpdateVersionModal && !this.isCompact;
}, },
getWindowsHref() { getWindowsHref() {
return this.responseData && this.responseData.length > 0 ? this.responseData[0].url : '#'; return this.responseData && this.responseData.length > 0 ? this.responseData[0].url : '#';