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

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

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

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

@ -110,24 +110,24 @@ function onOpenModal(type: ViewTypes, title = '') {
</div>
<div class="flex-1"></div>
<!-- <SmartsheetSidebarMenuApiSnippet v-model="showApiSnippet" />-->
<!-- <div class="flex-auto justify-end flex flex-col gap-3 mt-3">-->
<!-- <button-->
<!-- 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"-->
<!-- @click="onWebhooks"-->
<!-- >-->
<!-- <mdi-hook />{{ $t('objects.webhooks') }}-->
<!-- </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"-->
<!-- @click="onApiSnippet"-->
<!-- >-->
<!-- <mdi-xml />Get API Snippet-->
<!-- </button>-->
<!-- </div>-->
<!-- <SmartsheetSidebarMenuApiSnippet v-model="showApiSnippet" /> -->
<!-- <div class="flex-auto justify-end flex flex-col gap-3 mt-3"> -->
<!-- <button -->
<!-- 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" -->
<!-- @click="onWebhooks" -->
<!-- > -->
<!-- <mdi-hook />{{ $t('objects.webhooks') }} -->
<!-- </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" -->
<!-- @click="onApiSnippet" -->
<!-- > -->
<!-- <mdi-xml />Get API Snippet -->
<!-- </button> -->
<!-- </div> -->
<general-flipping-card class="my-4 lg:my-6 min-h-[100px]" :triggers="['click', { duration: 15000 }]">
<template #front>

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

@ -170,7 +170,7 @@ function onDeleted() {
</script>
<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">
<RenameableMenuItem

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

@ -113,5 +113,4 @@ const Icon = computed(() => {
.nc-subtitle {
@apply font-size-sm font-weight-light;
}
</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>
<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>
<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)"
/>
</div>
</a-tooltip>-->
</a-tooltip> -->
<a-button @click="toggle(!isOpen)" size="small">
<div class="flex items-center gap-2"> <MdiMenu/> Views
</div>
<a-button size="small" @click="toggle(!isOpen)">
<div class="flex items-center gap-2"><MdiMenu /> Views</div>
</a-button>
</template>

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

@ -47,20 +47,17 @@ const { isOpen } = useSidebar({ storageKey: 'nc-right-sidebar' })
</template>
<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 />-->
<!-- <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 }" />-->
<!-- <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 }" /> -->
<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" />
</div>
<SmartsheetSidebar class="nc-right-sidebar" v-if="meta" />
<SmartsheetSidebar v-if="meta" class="nc-right-sidebar" />
</div>
</template>
</div>
</div>
</template>
<style scoped>
:deep(.nc-right-sidebar.ant-layout-sider-collapsed) {
@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>
</template>
</div>
<div
v-if="!isLocked && isUIAllowed('xcDatatableEditable')"
class="flex-1 flex justify-end gap-1 min-h-[30px] items-center"
>
<div v-if="!isLocked && isUIAllowed('xcDatatableEditable')" class="flex-1 flex justify-end gap-1 min-h-[30px] items-center">
<MdiArrowExpand
class="select-none transform text-sm nc-action-icon text-gray-500/50 hover:text-gray-500 nc-arrow-expand"
@click="childListDlg = true"

Loading…
Cancel
Save