Browse Source

fix(nc-gui): disable banner & logo upload in oss

pull/7741/head
Ramesh Mane 9 months ago
parent
commit
9924c1ac45
  1. 25
      packages/nc-gui/components/smartsheet/Form.vue
  2. 1
      packages/nc-gui/lang/en.json

25
packages/nc-gui/components/smartsheet/Form.vue

@ -463,7 +463,7 @@ const handleChangeBackground = (color: string) => {
}
const openUploadImage = (isUploadBanner: boolean) => {
if (!isEditable) return
if (!isEditable || !isEeUI) return
imageCropperData.value.uploadConfig = {
path: [NOCO, base.value.id, meta.value?.id, formViewData.value?.id].join('/'),
@ -723,11 +723,17 @@ useEventListener(
<GeneralFormBanner :banner-image-url="formViewData.banner_image_url" />
<div class="absolute bottom-0 right-0 hidden group-hover:block">
<div class="flex items-center space-x-1 m-2">
<NcTooltip :disabled="isEeUI">
<template #title>
{{ $t('msg.info.thisFeatureIsOnlyAvailableInEnterpriseEdition') }}
</template>
<NcButton
type="secondary"
size="small"
class="nc-form-upload-banner-btn"
data-testid="nc-form-upload-banner-btn"
:disabled="!isEeUI"
@click="openUploadImage(true)"
>
<div class="flex gap-2 items-center">
@ -738,7 +744,8 @@ useEventListener(
</span>
</div>
</NcButton>
<NcTooltip v-if="formViewData.banner_image_url">
</NcTooltip>
<NcTooltip v-if="isEeUI && formViewData.banner_image_url">
<template #title> {{ $t('general.delete') }} {{ $t('general.banner') }} </template>
<NcButton
type="secondary"
@ -788,12 +795,17 @@ useEventListener(
class="items-center space-x-1 flex-nowrap m-3"
:class="formViewData.logo_url ? 'hidden absolute top-0 left-0 group-hover:flex' : 'flex'"
>
<NcTooltip :disabled="isEeUI">
<template #title>
{{ $t('msg.info.thisFeatureIsOnlyAvailableInEnterpriseEdition') }}
</template>
<NcButton
v-if="isEditable"
type="secondary"
size="small"
class="nc-form-upload-logo-btn"
data-testid="nc-form-upload-log-btn"
:disabled="!isEeUI"
@click="openUploadImage(false)"
>
<div class="flex gap-2 items-center">
@ -801,7 +813,8 @@ useEventListener(
<span> {{ formViewData.logo_url ? $t('general.replace') : $t('general.upload') }} Logo</span>
</div>
</NcButton>
<NcTooltip v-if="formViewData.logo_url">
</NcTooltip>
<NcTooltip v-if="isEeUI && formViewData.logo_url">
<template #title> {{ $t('general.delete') }} {{ $t('general.logo') }} </template>
<NcButton
type="secondary"
@ -1467,12 +1480,12 @@ useEventListener(
}
"
/>
<a-tooltip v-else placement="top">
<NcTooltip v-else placement="top">
<template #title>
{{ $t('msg.info.upgradeToEnterpriseEdition', { extraInfo: `to ${$t('labels.hideNocodbBranding')}` }) }}
{{ $t('msg.info.thisFeatureIsOnlyAvailableInEnterpriseEdition') }}
</template>
<a-switch :checked="false" size="small" :disabled="true" />
</a-tooltip>
</NcTooltip>
<span class="ml-4">{{ $t('labels.hideNocodbBranding') }}</span>
</div>
</div>

1
packages/nc-gui/lang/en.json

@ -1306,6 +1306,7 @@
"groupPasteIsNotSupportedOnLinksColumn": "Group paste operation is not supported on Links/LinkToAnotherRecord column",
"groupClearIsNotSupportedOnLinksColumn": "Group clear operation is not supported on Links/LinkToAnotherRecord column",
"upgradeToEnterpriseEdition": "Upgrade to Enterprise Edition {extraInfo}",
"thisFeatureIsOnlyAvailableInEnterpriseEdition": "This feature is only available in enterprise edition",
"yourCurrentRoleIs": "Your current role is",
"pleaseRequestAccessForView": "Please request for higher permission from the Admin / Base owner / Workspace owner to get access to this {viewName}",
"preventHideAllOptions": "You cannot hide all options if field is required"

Loading…
Cancel
Save