Browse Source

feat: move attachment carousel comments to beta feature toggle

pull/9799/head
DarkPhoenix2704 2 weeks ago
parent
commit
79030a385e
  1. 24
      packages/nc-gui/components/cell/attachment/Carousel.vue
  2. 7
      packages/nc-gui/composables/useBetaFeatureToggle.ts

24
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -137,7 +137,8 @@ function onKeyDown(event: KeyboardEvent) {
} }
} }
/* const { isFeatureEnabled } = useBetaFeatureToggle()
const openComments = ref(false) const openComments = ref(false)
const toggleComment = () => { const toggleComment = () => {
@ -145,12 +146,16 @@ const toggleComment = () => {
} }
onMounted(() => { onMounted(() => {
if (!isPublic.value && !isExpandedFormOpen.value && isUIAllowed('commentList')) { if (
!isPublic.value &&
!isExpandedFormOpen.value &&
isUIAllowed('commentList') &&
isFeatureEnabled(FEATURE_FLAG.ATTACHMENT_CAROUSEL_COMMENTS)
) {
const { loadComments } = useRowCommentsOrThrow() const { loadComments } = useRowCommentsOrThrow()
loadComments() loadComments()
} }
}) })
*/
const initEmblaApi = (val: any) => { const initEmblaApi = (val: any) => {
emblaMainApi.value = val emblaMainApi.value = val
@ -246,14 +251,17 @@ const initEmblaApi = (val: any) => {
<component :is="iconMap.arrowRight" class="text-7xl" /> <component :is="iconMap.arrowRight" class="text-7xl" />
</div> </div>
<!-- <div v-if="isUIAllowed('commentList') && !isExpandedFormOpen" class="absolute top-2 right-2"> <div
v-if="isUIAllowed('commentList') && !isExpandedFormOpen && isFeatureEnabled(FEATURE_FLAG.ATTACHMENT_CAROUSEL_COMMENTS)"
class="absolute top-2 right-2"
>
<NcButton class="!hover:bg-transparent" type="text" size="small" @click="toggleComment"> <NcButton class="!hover:bg-transparent" type="text" size="small" @click="toggleComment">
<div class="flex gap-1 text-white justify-center items-center"> <div class="flex gap-1 text-white justify-center items-center">
Comments Comments
<GeneralIcon icon="messageCircle" /> <GeneralIcon icon="messageCircle" />
</div> </div>
</NcButton> </NcButton>
</div> --> </div>
<div class="text-white absolute right-2 top-2 cursor-pointer"></div> <div class="text-white absolute right-2 top-2 cursor-pointer"></div>
@ -365,8 +373,8 @@ const initEmblaApi = (val: any) => {
</template> </template>
</GeneralDeleteModal> </GeneralDeleteModal>
</div> </div>
<!-- <div <div
v-if="isUIAllowed('commentList') && !isExpandedFormOpen" v-if="isUIAllowed('commentList') && !isExpandedFormOpen && isFeatureEnabled(FEATURE_FLAG.ATTACHMENT_CAROUSEL_COMMENTS)"
:class="{ :class="{
'w-0': !openComments, 'w-0': !openComments,
'!w-88': openComments, '!w-88': openComments,
@ -374,7 +382,7 @@ const initEmblaApi = (val: any) => {
class="bg-white max-w-88 transition-all" class="bg-white max-w-88 transition-all"
> >
<LazySmartsheetExpandedFormSidebarComments /> <LazySmartsheetExpandedFormSidebarComments />
</div> --> </div>
</div> </div>
</GeneralOverlay> </GeneralOverlay>
</template> </template>

7
packages/nc-gui/composables/useBetaFeatureToggle.ts

@ -29,6 +29,13 @@ const FEATURES = [
enabled: false, enabled: false,
isEngineering: true, isEngineering: true,
}, },
{
id: 'attachment_carousel_comments',
title: 'Comments in attachment carousel',
description: 'Enable comments in attachment carousel.',
enabled: false,
isEngineering: true,
},
] ]
export const FEATURE_FLAG = Object.fromEntries(FEATURES.map((feature) => [feature.id.toUpperCase(), feature.id])) as Record< export const FEATURE_FLAG = Object.fromEntries(FEATURES.map((feature) => [feature.id.toUpperCase(), feature.id])) as Record<

Loading…
Cancel
Save