Browse Source

chore(gui-v2): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3133/head
Pranav C 2 years ago
parent
commit
fd05864b08
  1. 5
      packages/nc-gui-v2/components/cell/attachment/index.vue
  2. 9
      packages/nc-gui-v2/components/dlg/AirtableImport.vue
  3. 5
      packages/nc-gui-v2/components/smartsheet-toolbar/FieldsMenu.vue
  4. 2
      packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue
  5. 43
      packages/nc-gui-v2/components/smartsheet/Form.vue
  6. 2
      packages/nc-gui-v2/components/smartsheet/Toolbar.vue
  7. 1
      packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue
  8. 3
      packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
  9. 4
      packages/nc-gui-v2/layouts/base.vue

5
packages/nc-gui-v2/components/cell/attachment/index.vue

@ -131,7 +131,10 @@ onKeyDown('Escape', () => {
<a-tooltip v-else placement="bottom">
<template #title> View attachments </template>
<MdiArrowExpand class="select-none transform group-hover:(text-pink-500 scale-120) text-[10px] text-gray-500" @click.stop="modalVisible = true" />
<MdiArrowExpand
class="select-none transform group-hover:(text-pink-500 scale-120) text-[10px] text-gray-500"
@click.stop="modalVisible = true"
/>
</a-tooltip>
</div>
</template>

9
packages/nc-gui-v2/components/dlg/AirtableImport.vue

@ -224,7 +224,13 @@ onBeforeUnmount(() => {
</script>
<template>
<a-modal v-model:visible="dialogShow" width="max(30vw, 600px)" :mask-closable="false" @keydown.esc="dialogShow = false" class="pa-2">
<a-modal
v-model:visible="dialogShow"
width="max(30vw, 600px)"
:mask-closable="false"
class="pa-2"
@keydown.esc="dialogShow = false"
>
<template #footer>
<div v-if="step === 1">
<a-button key="back" @click="dialogShow = false">{{ $t('general.cancel') }}</a-button>
@ -241,7 +247,6 @@ onBeforeUnmount(() => {
</template>
<span class="ml-5 mt-5 prose-xl font-weight-bold" type="secondary" :level="5">QUICK IMPORT - AIRTABLE</span>
<div class="ml-5 mr-5">
<div v-if="step === 1">
<div class="mb-4">
<span class="mr-3 pt-2 text-gray-500 text-xs">Credentials</span>

5
packages/nc-gui-v2/components/smartsheet-toolbar/FieldsMenu.vue

@ -79,7 +79,10 @@ const onMove = (event: { moved: { newIndex: number } }) => {
</a-button>
</div>
<template #overlay>
<div class="p-3 min-w-[280px] bg-gray-50 shadow-lg nc-table-toolbar-menu max-h-[max(80vh,500px)] overflow-auto !border" @click.stop>
<div
class="p-3 min-w-[280px] bg-gray-50 shadow-lg nc-table-toolbar-menu max-h-[max(80vh,500px)] overflow-auto !border"
@click.stop
>
<div class="p-1" @click.stop>
<a-input v-model:value="filterQuery" size="small" :placeholder="$t('placeholder.searchFields')" />
</div>

2
packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue

@ -84,7 +84,7 @@ watch(
<!-- </v-select> -->
</template>
</div>
<a-button class="text-capitalize mb-1 mt-4" @click.stop="addSort" type="primary" ghost>
<a-button class="text-capitalize mb-1 mt-4" type="primary" ghost @click.stop="addSort">
<div class="flex gap-1 align-center">
<MdiAddIcon />
<!-- Add Sort Option -->

43
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -106,8 +106,10 @@ function isDbRequired(column: Record<string, any>) {
// primary column
(column.pk && !column.ai && !column.cdf)
if (column.uidt === UITypes.LinkToAnotherRecord && column.colOptions.type === RelationTypes.BELONGS_TO) {
const col = columns.value.find((c: Record<string, any>) => c.id === column.colOptions.fk_child_column_id) as Record<string,
any>
const col = columns.value.find((c: Record<string, any>) => c.id === column.colOptions.fk_child_column_id) as Record<
string,
any
>
if (col.rqd && !col.default) {
isRequired = true
}
@ -209,8 +211,7 @@ function setFormData() {
let data: Record<string, boolean> = {}
try {
data = JSON.parse(formViewData.value.email as string) || {}
} catch (e) {
}
} catch (e) {}
data[state.user.value?.email as string] = emailMe.value
formViewData.value.email = JSON.stringify(data)
checkSMTPStatus()
@ -237,8 +238,10 @@ function isRequired(_columnObj: Record<string, any>, required = false) {
columnObj.colOptions &&
columnObj.colOptions.type === RelationTypes.BELONGS_TO
) {
columnObj = columns.value.find((c: Record<string, any>) => c.id === columnObj.colOptions.fk_child_column_id) as Record<string,
any>
columnObj = columns.value.find((c: Record<string, any>) => c.id === columnObj.colOptions.fk_child_column_id) as Record<
string,
any
>
}
return required || (columnObj && columnObj.rqd && !columnObj.cdf)
@ -395,8 +398,7 @@ onMounted(async () => {
</div>
</a-button>
<template #overlay>
<SmartsheetColumnEditOrAdd ref="editOrAddRef" @submit="submitCallback"
@cancel="showColumnDropdown = false"/>
<SmartsheetColumnEditOrAdd ref="editOrAddRef" @submit="submitCallback" @cancel="showColumnDropdown = false" />
</template>
</a-dropdown>
</template>
@ -445,8 +447,7 @@ onMounted(async () => {
@end="drag = false"
>
<template #item="{ element, index }">
<div class="nc-editable item cursor-pointer hover:bg-primary/10 pa-3"
@click="activeRow = element.title">
<div class="nc-editable item cursor-pointer hover:bg-primary/10 pa-3" @click="activeRow = element.title">
<div class="flex">
<div class="flex flex-1">
<div class="flex flex-row">
@ -503,8 +504,8 @@ onMounted(async () => {
</a-form-item>
<a-form-item class="mt-2 mb-0 w-1/2">
<a-input
size="small"
v-model:value="element.description"
size="small"
class="form-meta-input !bg-[#dbdbdb] text-sm"
:placeholder="$t('msg.info.formHelpText')"
@change="updateColMeta(element)"
@ -512,8 +513,7 @@ onMounted(async () => {
</a-form-item>
<div class="items-center flex">
<span class="text-sm text-gray-500 mr-2">{{ $t('general.required') }}</span>
<a-switch size="small" v-model:checked="element.required" class="my-2"
@change="updateColMeta(element)"/>
<a-switch v-model:checked="element.required" size="small" class="my-2" @change="updateColMeta(element)" />
</div>
</div>
<span class="text-gray-500">{{ element.description }}</span>
@ -535,14 +535,10 @@ onMounted(async () => {
{{ $t('general.submit') }}
</a-button>
</div>
</a-card>
</a-form>
<div class="mx-10 px-10">
<!-- After form is submitted -->
<div class="text-gray-500 mt-4 mb-2">
{{ $t('msg.info.afterFormSubmitted') }}
@ -555,9 +551,10 @@ onMounted(async () => {
<div class="mt-4">
<div class="my-4">
<!-- Show "Submit Another Form" button -->
<a-switch size="small"
<a-switch
v-model:checked="formViewData.submit_another_form"
v-t="[`a:form-view:submit-another-form`]"
size="small"
@change="updateView"
/>
<span class="ml-4">{{ $t('msg.info.submitAnotherForm') }}</span>
@ -565,21 +562,19 @@ onMounted(async () => {
<div class="my-4">
<!-- Show a blank form after 5 seconds -->
<a-switch size="small"
<a-switch
v-model:checked="formViewData.show_blank_form"
v-t="[`a:form-view:show-blank-form`]"
size="small"
@change="updateView"
/>
<span class="ml-4">{{ $t('msg.info.showBlankForm') }}</span>
</div>
<div class="my-4">
<a-switch size="small" v-model:checked="emailMe" v-t="[`a:form-view:email-me`]"
@change="onEmailChange"/>
<a-switch v-model:checked="emailMe" v-t="[`a:form-view:email-me`]" size="small" @change="onEmailChange" />
<!-- Email me at <email> -->
<span class="ml-4">
{{ $t('msg.info.emailForm') }} <span class="text-bold text-gray-600">{{
state.user.value?.email
}}</span>
{{ $t('msg.info.emailForm') }} <span class="text-bold text-gray-600">{{ state.user.value?.email }}</span>
</span>
</div>
</div>

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

@ -17,8 +17,6 @@ const { isGrid, isForm } = useSmartsheetStoreOrThrow()
<SmartsheetToolbarMoreActions v-if="isGrid" />
<div class="flex-1" />
<SmartsheetToolbarSearchData v-if="isGrid" class="shrink mr-2" />
</div>
</template>

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

@ -1,6 +1,5 @@
<script lang="ts" setup>
import AddRow from './AddRow.vue'
import DeleteTable from './DeleteTable.vue'
import LockMenu from './LockMenu.vue'
import Reload from './Reload.vue'
</script>

3
packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue

@ -1,7 +1,6 @@
<script lang="ts" setup>
import { Modal } from 'ant-design-vue'
import { Empty, Modal } from 'ant-design-vue'
import type { ColumnType } from 'nocodb-sdk'
import { Empty } from 'ant-design-vue'
import { computed, useLTARStoreOrThrow, useSmartsheetRowStoreOrThrow, useVModel, watch } from '#imports'
import { ColumnInj, IsFormInj } from '~/context'

4
packages/nc-gui-v2/layouts/base.vue

@ -22,7 +22,9 @@ const logout = () => {
<Transition name="layout">
<a-layout-header v-if="signedIn" class="flex !bg-primary items-center text-white pl-4 pr-5 shadow-lg">
<div
v-if="route.name === 'index' || route.name === 'project-index-create' || route.name === 'project-index-create-external'"
v-if="
route.name === 'index' || route.name === 'project-index-create' || route.name === 'project-index-create-external'
"
class="transition-all duration-200 p-2 cursor-pointer transform hover:scale-105"
@click="navigateTo('/')"
>

Loading…
Cancel
Save