Browse Source

chore(gui-v2): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2860/head
Pranav C 2 years ago
parent
commit
854a731273
  1. 15
      packages/nc-gui-v2/components/smartsheet-toolbar/SearchData.vue
  2. 8
      packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue
  3. 6
      packages/nc-gui-v2/components/smartsheet/Toolbar.vue
  4. 16
      packages/nc-gui-v2/composables/useViewFilters.ts

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

@ -13,7 +13,6 @@ const columns = computed(() =>
label: c.title, label: c.title,
})), })),
) )
</script> </script>
<template> <template>
@ -26,10 +25,16 @@ const columns = computed(() =>
> >
<template #addonBefore @click="isDropdownOpen = true"> <template #addonBefore @click="isDropdownOpen = true">
<div class="flex align-center relative"> <div class="flex align-center relative">
<MdiSearchIcon class="text-grey"/> <MdiSearchIcon class="text-grey" />
<MdiMenuDownIcon class="text-grey"/> <MdiMenuDownIcon class="text-grey" />
<a-select size="small" :dropdownMatchSelectWidth="false" v-model:value="search.field" :options="columns" class="!absolute top-0 left-0 w-full h-full z-10 !text-xs opacity-0"> <a-select
</a-select> v-model:value="search.field"
size="small"
:dropdown-match-select-width="false"
:options="columns"
class="!absolute top-0 left-0 w-full h-full z-10 !text-xs opacity-0"
>
</a-select>
</div> </div>
</template> </template>
</a-input> </a-input>

8
packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue

@ -110,7 +110,13 @@ const copyLink = () => {
</a-button> </a-button>
<!-- This view is shared via a private link --> <!-- This view is shared via a private link -->
<a-modal v-model:visible="showShareModel" size="small" :title="$t('msg.info.privateLink')" :footer="null" width="min(100vw,640px)"> <a-modal
v-model:visible="showShareModel"
size="small"
:title="$t('msg.info.privateLink')"
:footer="null"
width="min(100vw,640px)"
>
<div class="share-link-box nc-share-link-box bg-primary-50"> <div class="share-link-box nc-share-link-box bg-primary-50">
<div class="flex-1 h-min text-xs">{{ sharedViewUrl }}</div> <div class="flex-1 h-min text-xs">{{ sharedViewUrl }}</div>
<!-- <v-spacer /> --> <!-- <v-spacer /> -->

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

@ -13,7 +13,7 @@
<SmartsheetToolbarMoreActions /> <SmartsheetToolbarMoreActions />
<div class="flex-1" /> <div class="flex-1" />
<!-- <SmartsheetToolbarLockMenu /> <!-- <SmartsheetToolbarLockMenu />
<div class="dot" /> <div class="dot" />
<SmartsheetToolbarReload /> <SmartsheetToolbarReload />
<div class="dot" /> <div class="dot" />
@ -29,10 +29,8 @@
<style scoped> <style scoped>
:deep(.nc-toolbar-btn) { :deep(.nc-toolbar-btn) {
@apply border-0 !text-xs font-semibold px-2; @apply border-0 !text-xs font-semibold px-2;
}/* } /*
.dot { .dot {
@apply w-[3px] h-[3px] bg-gray-300 mx-1 rounded-full; @apply w-[3px] h-[3px] bg-gray-300 mx-1 rounded-full;
}*/ }*/
</style> </style>

16
packages/nc-gui-v2/composables/useViewFilters.ts

@ -1,6 +1,6 @@
import type {FilterType, GalleryType, GridType, KanbanType} from 'nocodb-sdk' import type { FilterType, GalleryType, GridType, KanbanType } from 'nocodb-sdk'
import type {ComputedRef, Ref} from 'vue' import type { ComputedRef, Ref } from 'vue'
import {useNuxtApp} from '#imports' import { useNuxtApp } from '#imports'
import useUIPermission from '~/composables/useUIPermission' import useUIPermission from '~/composables/useUIPermission'
export function useViewFilters( export function useViewFilters(
@ -8,14 +8,13 @@ export function useViewFilters(
parentId?: string, parentId?: string,
autoApply?: ComputedRef<boolean>, autoApply?: ComputedRef<boolean>,
reloadData?: () => void, reloadData?: () => void,
shared = false shared = false,
) { ) {
// todo: update swagger // todo: update swagger
const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])
const {$api} = useNuxtApp() const { $api } = useNuxtApp()
const {isUIAllowed} = useUIPermission() const { isUIAllowed } = useUIPermission()
const loadFilters = async () => { const loadFilters = async () => {
if (parentId) { if (parentId) {
@ -45,7 +44,6 @@ export function useViewFilters(
} }
const deleteFilter = async (filter: FilterType & { status: string }, i: number) => { const deleteFilter = async (filter: FilterType & { status: string }, i: number) => {
if (shared || !isUIAllowed('filterSync')) { if (shared || !isUIAllowed('filterSync')) {
const _filters = unref(filters.value) const _filters = unref(filters.value)
_filters.splice(i, 1) _filters.splice(i, 1)
@ -104,5 +102,5 @@ export function useViewFilters(
await saveOrUpdate(filters.value[index], index, true) await saveOrUpdate(filters.value[index], index, true)
} }
return {filters, loadFilters, sync, deleteFilter, saveOrUpdate, addFilter, addFilterGroup} return { filters, loadFilters, sync, deleteFilter, saveOrUpdate, addFilter, addFilterGroup }
} }

Loading…
Cancel
Save