Browse Source

fix: Removed create view ux feature flag

pull/6802/head
Muhammed Mustafa 1 year ago
parent
commit
52578f90aa
  1. 15
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  2. 12
      packages/nc-gui/components/dashboard/TreeView/ViewsList.vue
  3. 12
      packages/nc-gui/components/smartsheet/Toolbar.vue
  4. 4
      packages/nc-gui/store/config.ts

15
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -47,14 +47,9 @@ const { setMenuContext, openRenameTableDialog, duplicateTable } = inject(TreeVie
const { loadViews: _loadViews } = useViewsStore()
const { activeView } = storeToRefs(useViewsStore())
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { showCreateViewAllTimes } = storeToRefs(useConfigStore())
const { viewsByTable } = storeToRefs(useViewsStore())
const views = computed(() => viewsByTable.value.get(table.value.id!)?.filter((v) => !v.is_default) ?? [])
// todo: temp
const { baseTables, activeTableId } = storeToRefs(useTablesStore())
const { baseTables } = storeToRefs(useTablesStore())
const tables = computed(() => baseTables.value.get(base.value.id!) ?? [])
const openedTableId = computed(() => route.params.viewId)
@ -143,14 +138,6 @@ watch(
const isTableOpened = computed(() => {
return openedTableId.value === table.value?.id && activeView.value?.is_default
})
watch(activeTableId, () => {
if (showCreateViewAllTimes.value) return
if (activeTableId.value !== table.value.id && views.value.length === 0) {
isExpanded.value = false
}
})
</script>
<template>

12
packages/nc-gui/components/dashboard/TreeView/ViewsList.vue

@ -33,8 +33,6 @@ const table = inject(SidebarTableInj)!
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { showCreateViewAllTimes } = storeToRefs(useConfigStore())
const { activeTableId } = storeToRefs(useTablesStore())
const { isUIAllowed } = useRoles()
@ -389,12 +387,18 @@ function onOpenModal({
<DashboardTreeViewCreateViewBtn
v-if="isUIAllowed('viewCreateOrEdit')"
:class="{
'hidden': activeTableId !== table.id && views.length && !showCreateViewAllTimes,
'!ml-18 !xs:(ml-19.75)': isDefaultSource,
'!ml-23.5 !xs:(ml-27)': !isDefaultSource,
}"
>
<div role="button" class="flex flex-row items-center hover:text-brand-500 text-gray-500 cursor-pointer rounded-md max-w-40">
<div
role="button"
class="flex flex-row items-center cursor-pointer rounded-md max-w-40"
:class="{
'text-brand-500 hover:text-brand-600': activeTableId === table.id,
'text-gray-500 hover:text-brand-500': activeTableId !== table.id,
}"
>
<div class="flex flex-row items-center pl-1.25 !py-1.5 text-inherit">
<GeneralIcon icon="plus" />
<div class="pl-1.75">

12
packages/nc-gui/components/smartsheet/Toolbar.vue

@ -7,21 +7,11 @@ const isPublic = inject(IsPublicInj, ref(false))
const { isViewsLoading } = storeToRefs(useViewsStore())
const { showCreateViewAllTimes } = storeToRefs(useConfigStore())
const { isMobileMode } = useGlobal()
const { isUIAllowed } = useRoles()
const { allowCSVDownload } = useSharedView()
const toggleCreateViewAllTimes = () => {
showCreateViewAllTimes.value = !showCreateViewAllTimes.value
message.info({
content: showCreateViewAllTimes.value ? 'Create View All Times' : 'Create View Once',
})
}
</script>
<template>
@ -54,8 +44,6 @@ const toggleCreateViewAllTimes = () => {
<div class="flex-1" />
</template>
<div class="h-6 w-6 xs:hidden" @dblclick="toggleCreateViewAllTimes"></div>
<LazySmartsheetToolbarSearchData
v-if="(isGrid || isGallery || isKanban) && !isPublic"
:class="{

4
packages/nc-gui/store/config.ts

@ -21,9 +21,6 @@ export const useConfigStore = defineStore('configStore', () => {
isMobileMode.value = isViewPortMobile()
}
// Feature flag for create view all times
const showCreateViewAllTimes = ref(false)
window.addEventListener('DOMContentLoaded', onViewPortResize)
window.addEventListener('resize', onViewPortResize)
@ -70,7 +67,6 @@ export const useConfigStore = defineStore('configStore', () => {
isViewPortMobile,
handleSidebarOpenOnMobileForNonViews,
projectPageTab,
showCreateViewAllTimes,
}
})

Loading…
Cancel
Save