Browse Source

chore(gui-v2): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3262/head
Pranav C 2 years ago
parent
commit
851fb467cd
  1. 10
      packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue
  2. 17
      packages/nc-gui-v2/components/smartsheet/Toolbar.vue
  3. 36
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuBottom.vue
  4. 2
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue
  5. 1
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue
  6. 10
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ToggleDrawer.vue
  7. 15
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue
  8. 4
      packages/nc-gui-v2/components/tabs/Smartsheet.vue
  9. 5
      packages/nc-gui-v2/components/virtual-cell/HasMany.vue

10
packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue

@ -147,7 +147,7 @@ async function changeLockType(type: LockType) {
<template #overlay> <template #overlay>
<a-menu class="ml-6 !text-sm !p-0 !rounded"> <a-menu class="ml-6 !text-sm !p-0 !rounded">
<a-menu-item-group> <a-menu-item-group>
<a-sub-menu key="lock-type" v-if="isUIAllowed('view-type')" > <a-sub-menu v-if="isUIAllowed('view-type')" key="lock-type">
<template #title> <template #title>
<div v-t="['c:navdraw:preview-as']" class="nc-project-menu-item group"> <div v-t="['c:navdraw:preview-as']" class="nc-project-menu-item group">
<MdiFileEyeOutline class="group-hover:text-pink-500" /> <MdiFileEyeOutline class="group-hover:text-pink-500" />
@ -200,8 +200,7 @@ async function changeLockType(type: LockType) {
<MdiAccountIcon /> <MdiAccountIcon />
{{ $t('title.personalView') }} {{ $t('title.personalView') }}
<div class="nc-subtitle"> <div class="nc-subtitle">
Only you can edit the view configuration. Other collaborators personal views are hidden by Only you can edit the view configuration. Other collaborators personal views are hidden by default.
default.
</div> </div>
</div> </div>
</div> </div>
@ -268,13 +267,12 @@ async function changeLockType(type: LockType) {
</a-menu-item> </a-menu-item>
</a-sub-menu> </a-sub-menu>
<a-menu-item> <a-menu-item>
<div <div
v-if="isUIAllowed('SharedViewList') && !isView && !isPublicView" v-if="isUIAllowed('SharedViewList') && !isView && !isPublicView"
v-t="['a:actions:shared-view-list']" v-t="['a:actions:shared-view-list']"
@click="sharedViewListDlg = true"
class="py-2 flex gap-2" class="py-2 flex gap-2"
@click="sharedViewListDlg = true"
> >
<MdiViewListOutline class="text-gray-500" /> <MdiViewListOutline class="text-gray-500" />
<!-- Shared View List --> <!-- Shared View List -->
@ -282,7 +280,6 @@ async function changeLockType(type: LockType) {
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<div <div
v-if="isUIAllowed('webhook') && !isView && !isPublicView" v-if="isUIAllowed('webhook') && !isView && !isPublicView"
v-t="['c:actions:webhook']" v-t="['c:actions:webhook']"
@ -293,7 +290,6 @@ async function changeLockType(type: LockType) {
{{ $t('objects.webhooks') }} {{ $t('objects.webhooks') }}
</div> </div>
</a-menu-item> </a-menu-item>
</a-menu-item-group> </a-menu-item-group>
</a-menu> </a-menu>
</template> </template>

17
packages/nc-gui-v2/components/smartsheet/Toolbar.vue

@ -8,8 +8,7 @@ const { isGrid, isForm, isGallery } = useSmartsheetStoreOrThrow()
const { allowCSVDownload } = useSharedView() const { allowCSVDownload } = useSharedView()
const isPublic = inject(IsPublicInj, ref(false)) const isPublic = inject(IsPublicInj, ref(false))
const {isOpen} =useSidebar() const { isOpen } = useSidebar()
</script> </script>
<template> <template>
@ -24,21 +23,15 @@ const {isOpen} =useSidebar()
<SmartsheetToolbarShareView v-if="(isForm || isGrid) && !isPublic" /> <SmartsheetToolbarShareView v-if="(isForm || isGrid) && !isPublic" />
<!-- <SmartsheetToolbarMoreActions v-if="(isGrid && !isPublic) || (isGrid && isPublic && allowCSVDownload)" /> -->
<!-- <SmartsheetToolbarMoreActions v-if="(isGrid && !isPublic) || (isGrid && isPublic && allowCSVDownload)" />-->
<div class="flex-1" /> <div class="flex-1" />
<Reload />
<Reload/> <AddRow />
<AddRow/>
<SmartsheetToolbarSearchData v-if="(isGrid || isGallery) && !isPublic" class="shrink mr-2 ml-2" /> <SmartsheetToolbarSearchData v-if="(isGrid || isGallery) && !isPublic" class="shrink mr-2 ml-2" />
<ToggleDrawer class="mr-2"/> <ToggleDrawer class="mr-2" />
</div> </div>
</template> </template>

36
packages/nc-gui-v2/components/smartsheet/sidebar/MenuBottom.vue

@ -110,24 +110,24 @@ function onOpenModal(type: ViewTypes, title = '') {
</div> </div>
<div class="flex-1"></div> <div class="flex-1"></div>
<!-- <SmartsheetSidebarMenuApiSnippet v-model="showApiSnippet" />--> <!-- <SmartsheetSidebarMenuApiSnippet v-model="showApiSnippet" /> -->
<!-- <div class="flex-auto justify-end flex flex-col gap-3 mt-3">--> <!-- <div class="flex-auto justify-end flex flex-col gap-3 mt-3"> -->
<!-- <button--> <!-- <button -->
<!-- v-if="isUIAllowed('virtualViewsCreateOrEdit')"--> <!-- v-if="isUIAllowed('virtualViewsCreateOrEdit')" -->
<!-- class="flex items-center gap-2 w-full mx-3 px-4 py-3 rounded border transform translate-x-4 hover:(translate-x-0 shadow-lg) transition duration-150 ease !text-xs nc-webhook-btn"--> <!-- class="flex items-center gap-2 w-full mx-3 px-4 py-3 rounded border transform translate-x-4 hover:(translate-x-0 shadow-lg) transition duration-150 ease !text-xs nc-webhook-btn" -->
<!-- @click="onWebhooks"--> <!-- @click="onWebhooks" -->
<!-- >--> <!-- > -->
<!-- <mdi-hook />{{ $t('objects.webhooks') }}--> <!-- <mdi-hook />{{ $t('objects.webhooks') }} -->
<!-- </button>--> <!-- </button> -->
<!-- <button--> <!-- <button -->
<!-- class="flex items-center gap-2 w-full mx-3 px-4 py-3 rounded border transform translate-x-4 hover:(translate-x-0 shadow-lg) transition duration-150 ease !text-xs"--> <!-- class="flex items-center gap-2 w-full mx-3 px-4 py-3 rounded border transform translate-x-4 hover:(translate-x-0 shadow-lg) transition duration-150 ease !text-xs" -->
<!-- @click="onApiSnippet"--> <!-- @click="onApiSnippet" -->
<!-- >--> <!-- > -->
<!-- <mdi-xml />Get API Snippet--> <!-- <mdi-xml />Get API Snippet -->
<!-- </button>--> <!-- </button> -->
<!-- </div>--> <!-- </div> -->
<general-flipping-card class="my-4 lg:my-6 min-h-[100px]" :triggers="['click', { duration: 15000 }]"> <general-flipping-card class="my-4 lg:my-6 min-h-[100px]" :triggers="['click', { duration: 15000 }]">
<template #front> <template #front>

2
packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue

@ -170,7 +170,7 @@ function onDeleted() {
</script> </script>
<template> <template>
<!-- <h3 class="pt-3 px-3 text-xs text-gray-500 font-semibold">{{ $t('objects.views') }}</h3>--> <!-- <h3 class="pt-3 px-3 text-xs text-gray-500 font-semibold">{{ $t('objects.views') }}</h3> -->
<a-menu ref="menuRef" :class="{ dragging }" class="nc-views-menu" :selected-keys="selected"> <a-menu ref="menuRef" :class="{ dragging }" class="nc-views-menu" :selected-keys="selected">
<RenameableMenuItem <RenameableMenuItem

1
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/LockMenu.vue

@ -113,5 +113,4 @@ const Icon = computed(() => {
.nc-subtitle { .nc-subtitle {
@apply font-size-sm font-weight-light; @apply font-size-sm font-weight-light;
} }
</style> </style>

10
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ToggleDrawer.vue

@ -4,7 +4,7 @@ const { isOpen, toggle } = useSidebar({ storageKey: 'nc-right-sidebar' })
</script> </script>
<template> <template>
<!-- <a-tooltip :placement="isOpen ? 'bottomRight' : 'left'" :mouse-enter-delay="0.8"> <!-- <a-tooltip :placement="isOpen ? 'bottomRight' : 'left'" :mouse-enter-delay="0.8">
<template #title> Toggle sidebar</template> <template #title> Toggle sidebar</template>
<div class="nc-sidebar-right-item hover:after:(bg-primary bg-opacity-75) group nc-sidebar-add-row"> <div class="nc-sidebar-right-item hover:after:(bg-primary bg-opacity-75) group nc-sidebar-add-row">
@ -14,11 +14,9 @@ const { isOpen, toggle } = useSidebar({ storageKey: 'nc-right-sidebar' })
@click="toggle(!isOpen)" @click="toggle(!isOpen)"
/> />
</div> </div>
</a-tooltip>--> </a-tooltip> -->
<a-button @click="toggle(!isOpen)" size="small"> <a-button size="small" @click="toggle(!isOpen)">
<div class="flex items-center gap-2"> <MdiMenu/> Views <div class="flex items-center gap-2"><MdiMenu /> Views</div>
</div>
</a-button> </a-button>
</template> </template>

15
packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue

@ -47,20 +47,17 @@ const { isOpen } = useSidebar({ storageKey: 'nc-right-sidebar' })
</template> </template>
<h3 class="pt-3 px-3 text-xs text-gray-500 font-semibold">{{ $t('objects.views') }}</h3> <h3 class="pt-3 px-3 text-xs text-gray-500 font-semibold">{{ $t('objects.views') }}</h3>
<!-- <LockMenu v-if="isUIAllowed('view-type')" @click.stop />--> <!-- <LockMenu v-if="isUIAllowed('view-type')" @click.stop /> -->
<!-- <div v-if="isUIAllowed('view-type')" class="dot" />--> <!-- <div v-if="isUIAllowed('view-type')" class="dot" /> -->
<!-- <Reload @click.stop />--> <!-- <Reload @click.stop /> -->
<!-- <div class="dot" />-->
<!-- <AddRow v-if="isUIAllowed('xcDatatableEditable')" @click.stop />-->
<!-- <div :class="{ 'w-[calc(100%_+_16px)] h-[1px] bg-gray-200 mt-1 -ml-1': !isOpen, 'dot': isOpen }" />-->
<!-- <div class="dot" /> -->
<!-- <AddRow v-if="isUIAllowed('xcDatatableEditable')" @click.stop /> -->
<!-- <div :class="{ 'w-[calc(100%_+_16px)] h-[1px] bg-gray-200 mt-1 -ml-1': !isOpen, 'dot': isOpen }" /> -->
<ToggleDrawer /> <ToggleDrawer />

4
packages/nc-gui-v2/components/tabs/Smartsheet.vue

@ -83,15 +83,13 @@ watch(isLocked, (nextValue) => (treeViewIsLockedInj.value = nextValue), { immedi
<SmartsheetForm v-else-if="isForm" /> <SmartsheetForm v-else-if="isForm" />
</div> </div>
<SmartsheetSidebar class="nc-right-sidebar" v-if="meta" /> <SmartsheetSidebar v-if="meta" class="nc-right-sidebar" />
</div> </div>
</template> </template>
</div> </div>
</div> </div>
</template> </template>
<style scoped> <style scoped>
:deep(.nc-right-sidebar.ant-layout-sider-collapsed) { :deep(.nc-right-sidebar.ant-layout-sider-collapsed) {
@apply !w-0 !max-w-0 !min-w-0 overflow-x-hidden; @apply !w-0 !max-w-0 !min-w-0 overflow-x-hidden;

5
packages/nc-gui-v2/components/virtual-cell/HasMany.vue

@ -95,10 +95,7 @@ const unlinkRef = async (rec: Record<string, any>) => {
</span> </span>
</template> </template>
</div> </div>
<div <div v-if="!isLocked && isUIAllowed('xcDatatableEditable')" class="flex-1 flex justify-end gap-1 min-h-[30px] items-center">
v-if="!isLocked && isUIAllowed('xcDatatableEditable')"
class="flex-1 flex justify-end gap-1 min-h-[30px] items-center"
>
<MdiArrowExpand <MdiArrowExpand
class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand" class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand"
@click="childListDlg = true" @click="childListDlg = true"

Loading…
Cancel
Save