Browse Source

Merge pull request #6315 from nocodb/fix/lint-err

fix: lint errors and warnings
pull/6377/head
աɨռɢӄաօռɢ 1 year ago committed by GitHub
parent
commit
0213d06f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/cell/TextArea.vue
  2. 2
      packages/nc-gui/components/cell/attachment/Carousel.vue
  3. 3
      packages/nc-gui/components/cell/attachment/utils.ts
  4. 2
      packages/nc-gui/components/dashboard/Sidebar/Header.vue
  5. 2
      packages/nc-gui/components/dashboard/Sidebar/TopSection/Header.vue
  6. 62
      packages/nc-gui/components/dashboard/TreeView/BaseOptions.vue
  7. 4
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  8. 39
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  9. 37
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  10. 1
      packages/nc-gui/components/dlg/AirtableImport.vue
  11. 4
      packages/nc-gui/components/dlg/ProjectDelete.vue
  12. 19
      packages/nc-gui/components/dlg/TableCreate.vue
  13. 3
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  14. 2
      packages/nc-gui/components/dlg/share-and-collaborate/View.vue
  15. 5
      packages/nc-gui/components/general/DeleteModal.vue
  16. 2
      packages/nc-gui/components/general/UserIcon.vue
  17. 2
      packages/nc-gui/components/project/AccessSettings.vue
  18. 6
      packages/nc-gui/components/project/InviteProjectCollabSection.vue
  19. 9
      packages/nc-gui/components/project/View.vue
  20. 1
      packages/nc-gui/components/smartsheet/Gallery.vue
  21. 4
      packages/nc-gui/components/smartsheet/Pagination.vue
  22. 2
      packages/nc-gui/components/smartsheet/Toolbar.vue
  23. 6
      packages/nc-gui/components/smartsheet/Topbar.vue
  24. 6
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue
  25. 4
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  26. 14
      packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue
  27. 2
      packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue
  28. 3
      packages/nc-gui/components/tabs/Smartsheet.vue
  29. 1
      packages/nc-gui/components/workspace/CollaboratorsList.vue
  30. 2
      packages/nc-gui/components/workspace/CreateProjectDlg.vue
  31. 7
      packages/nc-gui/components/workspace/ProjectList.vue
  32. 2
      packages/nc-gui/components/workspace/View.vue
  33. 4
      packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index.vue
  34. 2
      packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index/[viewId]/[[viewTitle]]/[...slugs].vue
  35. 7
      packages/nc-gui/utils/iconUtils.ts
  36. 2
      packages/nocodb/src/Noco.ts
  37. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts
  38. 2
      packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts
  39. 2
      packages/nocodb/src/plugins/discord/Discord.ts
  40. 2
      packages/nocodb/src/plugins/mattermost/Mattermost.ts
  41. 2
      packages/nocodb/src/plugins/slack/Slack.ts
  42. 2
      packages/nocodb/src/plugins/teams/Teams.ts
  43. 2
      packages/nocodb/src/plugins/twilio/Twilio.ts
  44. 2
      packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsapp.ts
  45. 2
      packages/nocodb/src/services/api-docs/swagger/templates/params.ts
  46. 2
      packages/nocodb/src/services/api-docs/swagger/templates/paths.ts
  47. 8
      packages/nocodb/src/services/tables.service.ts

2
packages/nc-gui/components/cell/TextArea.vue

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import { EditModeInj, IsExpandedFormOpenInj, RowHeightInj, inject, useVModel, iconMap, ActiveCellInj } from '#imports' import { ActiveCellInj, EditModeInj, IsExpandedFormOpenInj, RowHeightInj, iconMap, inject, useVModel } from '#imports'
const props = defineProps<{ const props = defineProps<{
modelValue?: string | number modelValue?: string | number

2
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onKeyDown } from '@vueuse/core' import { onKeyDown } from '@vueuse/core'
import { useAttachmentCell } from './utils' import { useAttachmentCell } from './utils'
import { computed, iconMap, isImage, onClickOutside, ref, useAttachment, useEventListener } from '#imports' import { computed, iconMap, isImage, ref, useAttachment, useEventListener } from '#imports'
const { selectedImage, visibleItems, downloadFile } = useAttachmentCell()! const { selectedImage, visibleItems, downloadFile } = useAttachmentCell()!

3
packages/nc-gui/components/cell/attachment/utils.ts

@ -1,5 +1,4 @@
import type { AttachmentType } from 'nocodb-sdk' import type { AttachmentType } from 'nocodb-sdk'
import { readonly } from '@vue/reactivity'
import RenameFile from './RenameFile.vue' import RenameFile from './RenameFile.vue'
import { import {
ColumnInj, ColumnInj,
@ -34,8 +33,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
(updateModelValue: (data: string | Record<string, any>[]) => void) => { (updateModelValue: (data: string | Record<string, any>[]) => void) => {
const isReadonly = inject(ReadonlyInj, ref(false)) const isReadonly = inject(ReadonlyInj, ref(false))
const isLockedMode = inject(IsLockedInj, ref(false))
const isPublic = inject(IsPublicInj, ref(false)) const isPublic = inject(IsPublicInj, ref(false))
const isForm = inject(IsFormInj, ref(false)) const isForm = inject(IsFormInj, ref(false))

2
packages/nc-gui/components/dashboard/Sidebar/Header.vue

@ -1,10 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
const workspaceStore = useWorkspace() const workspaceStore = useWorkspace()
const projectStore = useProject()
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isSharedBase } = storeToRefs(projectStore)
const { activeWorkspace, isWorkspaceLoading } = storeToRefs(workspaceStore) const { activeWorkspace, isWorkspaceLoading } = storeToRefs(workspaceStore)
</script> </script>

2
packages/nc-gui/components/dashboard/Sidebar/TopSection/Header.vue

@ -1 +1 @@
<template></template> <template><span /></template>

62
packages/nc-gui/components/dashboard/TreeView/BaseOptions.vue

@ -114,66 +114,4 @@ function openQuickImportDialog(type: string) {
</div> </div>
</a-menu-item> </a-menu-item>
</a-sub-menu> </a-sub-menu>
<a-menu-divider v-if="false" class="my-0" />
<!-- Connect to new datasource -->
<!-- <a-sub-menu>
<template #title>
<div class="nc-project-menu-item group">
<GeneralIcon icon="datasource" class="group-hover:text-black" />
Connect to new datasource
<div class="flex-1" />
<MaterialSymbolsChevronRightRounded class="transform group-hover:(scale-115 text-accent) text-xl text-gray-400" />
</div>
</template>
<template #expandIcon></template>
<a-menu-item key="connect-new-source" @click="toggleDialog(true, 'dataSources', ClientType.MYSQL, project.id)">
<div class="color-transition nc-project-menu-item group">
<LogosMysqlIcon class="group-hover:text-black" />
MySQL
</div>
</a-menu-item>
<a-menu-item key="connect-new-source" @click="toggleDialog(true, 'dataSources', ClientType.PG, project.id)">
<div class="color-transition nc-project-menu-item group">
<LogosPostgresql class="group-hover:text-black" />
Postgres
</div>
</a-menu-item>
<a-menu-item key="connect-new-source" @click="toggleDialog(true, 'dataSources', ClientType.SQLITE, project.id)">
<div class="color-transition nc-project-menu-item group">
<VscodeIconsFileTypeSqlite class="group-hover:text-black" />
SQLite
</div>
</a-menu-item>
<a-menu-item key="connect-new-source" @click="toggleDialog(true, 'dataSources', ClientType.MSSQL, project.id)">
<div class="color-transition nc-project-menu-item group">
<SimpleIconsMicrosoftsqlserver class="group-hover:text-black" />
MSSQL
</div>
</a-menu-item>
<a-menu-item
v-if="appInfo.ee"
key="connect-new-source"
@click="toggleDialog(true, 'dataSources', ClientType.SNOWFLAKE, project.id)"
>
<div class="color-transition nc-project-menu-item group">
<LogosSnowflakeIcon class="group-hover:text-black" />
Snowflake
</div>
</a-menu-item>
<a-menu-item v-if="isUIAllowed('importRequest', false, projectRole)" key="add-new-table" class="py-1 rounded-b">
<a
v-e="['e:datasource:import-request']"
href="https://github.com/nocodb/nocodb/issues/2052"
target="_blank"
class="prose-sm hover:(!text-primary !opacity-100) color-transition nc-project-menu-item group after:(!rounded-b)"
>
<GeneralIcon icon="openInNew" class="group-hover:text-black" />
{{ $t('labels.requestDataSource') }}
</a>
</a-menu-item>
</a-sub-menu> -->
</template> </template>

4
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -472,8 +472,6 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-divider v-if="false" />
<!-- ERD View --> <!-- ERD View -->
<a-menu-item key="erd" @click="openProjectErdView(project)"> <a-menu-item key="erd" @click="openProjectErdView(project)">
<div class="nc-project-menu-item group"> <div class="nc-project-menu-item group">
@ -513,8 +511,6 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string
<a-menu-divider /> <a-menu-divider />
</template> </template>
<a-menu-divider v-if="false" />
<a-menu-item v-if="isUIAllowed('projectDelete', false, projectRole)" @click="isProjectDeleteDialogVisible = true"> <a-menu-item v-if="isUIAllowed('projectDelete', false, projectRole)" @click="isProjectDeleteDialogVisible = true">
<div class="nc-project-menu-item group text-red-500"> <div class="nc-project-menu-item group text-red-500">
<GeneralIcon icon="delete" /> <GeneralIcon icon="delete" />

39
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Form, Modal, message } from 'ant-design-vue' import { Form, message } from 'ant-design-vue'
import type { SelectHandler } from 'ant-design-vue/es/vc-select/Select' import type { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
import type { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports' import type { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports'
import { import {
@ -423,43 +423,6 @@ watch(
<a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" /> <a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" />
</a-form-item> </a-form-item>
<template v-else-if="formState.dataSource.client === ClientType.SNOWFLAKE && false">
<!-- Account -->
<a-form-item label="Account" v-bind="validateInfos['dataSource.connection.account']">
<a-input v-model:value="formState.dataSource.connection.account" class="nc-extdb-account" />
</a-form-item>
<!-- Username -->
<a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.username']">
<a-input v-model:value="formState.dataSource.connection.username" class="nc-extdb-host-user" />
</a-form-item>
<!-- Password -->
<a-form-item :label="$t('labels.password')" v-bind="validateInfos['dataSource.connection.password']">
<a-input-password v-model:value="formState.dataSource.connection.password" class="nc-extdb-host-password" />
</a-form-item>
<!-- Warehouse -->
<a-form-item label="Warehouse" v-bind="validateInfos['dataSource.connection.warehouse']">
<a-input v-model:value="formState.dataSource.connection.warehouse" />
</a-form-item>
<!-- Database -->
<a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']">
<!-- Database : create if not exists -->
<a-input
v-model:value="formState.dataSource.connection.database"
:placeholder="$t('labels.dbCreateIfNotExists')"
class="nc-extdb-host-database"
/>
</a-form-item>
<!-- Schema name -->
<a-form-item :label="$t('labels.schemaName')" v-bind="validateInfos['dataSource.connection.schema']">
<a-input v-model:value="formState.dataSource.connection.schema" />
</a-form-item>
</template>
<template v-else> <template v-else>
<!-- Host Address --> <!-- Host Address -->
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']"> <a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']">

37
packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

@ -380,43 +380,6 @@ onMounted(async () => {
<a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" /> <a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" />
</a-form-item> </a-form-item>
<template v-else-if="formState.dataSource.client === ClientType.SNOWFLAKE && false">
<!-- Account -->
<a-form-item label="Account" v-bind="validateInfos['dataSource.connection.account']">
<a-input v-model:value="formState.dataSource.connection.account" class="nc-extdb-account" />
</a-form-item>
<!-- Username -->
<a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.username']">
<a-input v-model:value="formState.dataSource.connection.username" class="nc-extdb-host-user" />
</a-form-item>
<!-- Password -->
<a-form-item :label="$t('labels.password')" v-bind="validateInfos['dataSource.connection.password']">
<a-input-password v-model:value="formState.dataSource.connection.password" class="nc-extdb-host-password" />
</a-form-item>
<!-- Warehouse -->
<a-form-item label="Warehouse" v-bind="validateInfos['dataSource.connection.warehouse']">
<a-input v-model:value="formState.dataSource.connection.warehouse" />
</a-form-item>
<!-- Database -->
<a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']">
<!-- Database : create if not exists -->
<a-input
v-model:value="formState.dataSource.connection.database"
:placeholder="$t('labels.dbCreateIfNotExists')"
class="nc-extdb-host-database"
/>
</a-form-item>
<!-- Schema name -->
<a-form-item :label="$t('labels.schemaName')" v-bind="validateInfos['dataSource.connection.schema']">
<a-input v-model:value="formState.dataSource.connection.schema" />
</a-form-item>
</template>
<template v-else> <template v-else>
<!-- Host Address --> <!-- Host Address -->
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']"> <a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']">

1
packages/nc-gui/components/dlg/AirtableImport.vue

@ -12,7 +12,6 @@ import {
onMounted, onMounted,
ref, ref,
storeToRefs, storeToRefs,
useGlobal,
useNuxtApp, useNuxtApp,
useProject, useProject,
watch, watch,

4
packages/nc-gui/components/dlg/ProjectDelete.vue

@ -1,6 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import { navigateTo } from '#app'
const props = defineProps<{ const props = defineProps<{
visible: boolean visible: boolean
projectId: string projectId: string
@ -22,8 +20,6 @@ const project = computed(() => projects.value.get(props.projectId))
const isLoading = ref(false) const isLoading = ref(false)
const { projectsList } = storeToRefs(projectsStore)
const onDelete = async () => { const onDelete = async () => {
if (!project.value) return if (!project.value) return

19
packages/nc-gui/components/dlg/TableCreate.vue

@ -3,7 +3,6 @@ import {
Form, Form,
TabType, TabType,
computed, computed,
iconMap,
nextTick, nextTick,
onMounted, onMounted,
ref, ref,
@ -153,25 +152,7 @@ onMounted(() => {
:placeholder="$t('msg.info.enterTableName')" :placeholder="$t('msg.info.enterTableName')"
/> />
</a-form-item> </a-form-item>
<div v-if="false" class="flex justify-end items-center">
<div
class="pointer flex flex-row items-center gap-x-1 cursor-pointer"
@click="isAdvanceOptVisible = !isAdvanceOptVisible"
>
{{ isAdvanceOptVisible ? $t('general.hideAll') : $t('general.showMore') }}
<component :is="iconMap.minusCircle" v-if="isAdvanceOptVisible" class="text-gray-500" />
<component :is="iconMap.plusCircle" v-else class="text-gray-500" />
</div>
</div>
<div class="nc-table-advanced-options" :class="{ active: isAdvanceOptVisible }"> <div class="nc-table-advanced-options" :class="{ active: isAdvanceOptVisible }">
<!-- hint="Table name as saved in database" -->
<!-- <div v-if="!project.prefix" class="mb-2">{{ $t('msg.info.tableNameInDb') }}</div>
<a-form-item v-if="!project.prefix" v-bind="validateInfos.table_name">
<a-input v-model:value="table.table_name" size="large" hide-details :placeholder="$t('msg.info.tableNameInDb')" />
</a-form-item> -->
<div> <div>
<div class="mb-1"> <div class="mb-1">
<!-- Add Default Columns --> <!-- Add Default Columns -->

3
packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue

@ -2,8 +2,7 @@
import type { ColumnType, KanbanType, ViewType } from 'nocodb-sdk' import type { ColumnType, KanbanType, ViewType } from 'nocodb-sdk'
import { ViewTypes } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk'
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import { useTablesStore } from '~/store/tables' import { useMetas } from '#imports'
import { useMetas } from '~/composables/useMetas'
const { view: _view, $api } = useSmartsheetStoreOrThrow() const { view: _view, $api } = useSmartsheetStoreOrThrow()
const { $e } = useNuxtApp() const { $e } = useNuxtApp()

2
packages/nc-gui/components/dlg/share-and-collaborate/View.vue

@ -6,8 +6,6 @@ import { useViewsStore } from '~/store/views'
const { isViewToolbar } = defineProps<{ const { isViewToolbar } = defineProps<{
isViewToolbar?: boolean isViewToolbar?: boolean
}>() }>()
const router = useRouter()
const route = router.currentRoute
const { copy } = useCopy() const { copy } = useCopy()
const { dashboardUrl } = useDashboard() const { dashboardUrl } = useDashboard()

5
packages/nc-gui/components/general/DeleteModal.vue

@ -52,11 +52,6 @@ onKeyStroke('Enter', () => {
<slot name="entity-preview"></slot> <slot name="entity-preview"></slot>
<div v-if="false" class="flex flex-row items-center py-2 px-3 border-1 border-gray-100 rounded-lg text-gray-700">
<GeneralIcon icon="warning" class="text-orange-500"></GeneralIcon>
<div class="pl-2.5 text-gray-500">This action cannot be undone</div>
</div>
<div class="flex flex-row gap-x-2 mt-2.5 pt-2.5 justify-end"> <div class="flex flex-row gap-x-2 mt-2.5 pt-2.5 justify-end">
<NcButton type="secondary" @click="visible = false"> <NcButton type="secondary" @click="visible = false">
{{ $t('general.cancel') }} {{ $t('general.cancel') }}

2
packages/nc-gui/components/general/UserIcon.vue

@ -1,6 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UserType } from 'nocodb-sdk'
const props = defineProps<{ const props = defineProps<{
hideLabel?: boolean hideLabel?: boolean
size?: 'small' | 'medium' size?: 'small' | 'medium'

2
packages/nc-gui/components/project/AccessSettings.vue

@ -111,8 +111,6 @@ watchDebounced(
}, },
) )
const modal = ref(true)
const reloadCollabs = async () => { const reloadCollabs = async () => {
currentPage.value = 0 currentPage.value = 0
collaborators.value = [] collaborators.value = []

6
packages/nc-gui/components/project/InviteProjectCollabSection.vue

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ProjectRoles, WorkspaceUserRoles } from 'nocodb-sdk' import { ProjectRoles } from 'nocodb-sdk'
import { extractSdkResponseErrorMsg, useDashboard, useManageUsers, useProject, useWorkspace } from '#imports' import { extractSdkResponseErrorMsg, useDashboard, useManageUsers } from '#imports'
const emit = defineEmits(['invited']) const emit = defineEmits(['invited'])
@ -9,8 +9,6 @@ const inviteData = reactive({
roles: ProjectRoles.VIEWER, roles: ProjectRoles.VIEWER,
}) })
const projectStore = useProject()
const { dashboardUrl } = useDashboard() const { dashboardUrl } = useDashboard()
const { inviteUser } = useManageUsers() const { inviteUser } = useManageUsers()

9
packages/nc-gui/components/project/View.vue

@ -115,15 +115,6 @@ watch(
</template> </template>
<DashboardSettingsDataSources v-model:state="baseSettingsState" /> <DashboardSettingsDataSources v-model:state="baseSettingsState" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane v-if="false && isUIAllowed('acl')" key="ui-acl">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__ui-acl">
<GeneralIcon icon="acl" />
<div>{{ $t('title.uiACL') }}</div>
</div>
</template>
<DashboardSettingsUIAclTabs class="mt-6" />
</a-tab-pane>
</a-tabs> </a-tabs>
</div> </div>
</div> </div>

1
packages/nc-gui/components/smartsheet/Gallery.vue

@ -17,7 +17,6 @@ import {
computed, computed,
createEventHook, createEventHook,
extractPkFromRow, extractPkFromRow,
iconMap,
inject, inject,
isImage, isImage,
isLTAR, isLTAR,

4
packages/nc-gui/components/smartsheet/Pagination.vue

@ -28,12 +28,8 @@ const fixedSize = toRef(props, 'fixedSize')
const extraStyle = toRef(props, 'extraStyle') const extraStyle = toRef(props, 'extraStyle')
const isPublic = inject(IsPublicInj, ref(false))
const isGroupBy = inject(IsGroupByInj, ref(false)) const isGroupBy = inject(IsGroupByInj, ref(false))
const { isLeftSidebarOpen, isRightSidebarOpen } = storeToRefs(useSidebarStore())
const { isPaginationLoading } = storeToRefs(useViewsStore()) const { isPaginationLoading } = storeToRefs(useViewsStore())
const count = computed(() => vPaginationData.value?.totalRows ?? Infinity) const count = computed(() => vPaginationData.value?.totalRows ?? Infinity)

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

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { IsPublicInj, inject, ref, useSharedView, useSmartsheetStoreOrThrow, useUIPermission, useViewsStore } from '#imports' import { IsPublicInj, inject, ref, useSharedView, useSmartsheetStoreOrThrow, useUIPermission, useViewsStore } from '#imports'
const { isGrid, isForm, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow() const { isGrid, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow()
const isPublic = inject(IsPublicInj, ref(false)) const isPublic = inject(IsPublicInj, ref(false))

6
packages/nc-gui/components/smartsheet/Topbar.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { IsPublicInj, inject, ref, useSharedView, useSmartsheetStoreOrThrow, useUIPermission, useViewsStore } from '#imports' import { IsPublicInj, inject, ref, useSmartsheetStoreOrThrow, useViewsStore } from '#imports'
const { isGrid, isForm, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow() const { isGrid, isForm, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow()
@ -12,10 +12,6 @@ const { isViewsLoading } = storeToRefs(useViewsStore())
const { isMobileMode } = useGlobal() const { isMobileMode } = useGlobal()
const { isUIAllowed } = useUIPermission()
const { allowCSVDownload } = useSharedView()
const isSharedBase = computed(() => route.value.params.typeOrId === 'base') const isSharedBase = computed(() => route.value.params.typeOrId === 'base')
</script> </script>

6
packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue

@ -3,13 +3,11 @@ import type ColumnFilter from './ColumnFilter.vue'
import { import {
ActiveViewInj, ActiveViewInj,
IsLockedInj, IsLockedInj,
IsPublicInj,
computed, computed,
inject, inject,
ref, ref,
useGlobal, useGlobal,
useMenuCloseOnEsc, useMenuCloseOnEsc,
useNuxtApp,
useSmartsheetStoreOrThrow, useSmartsheetStoreOrThrow,
useViewFilters, useViewFilters,
watch, watch,
@ -21,14 +19,10 @@ const isLocked = inject(IsLockedInj, ref(false))
const activeView = inject(ActiveViewInj, ref()) const activeView = inject(ActiveViewInj, ref())
const isPublic = inject(IsPublicInj, ref(false))
const { filterAutoSave, isMobileMode } = useGlobal() const { filterAutoSave, isMobileMode } = useGlobal()
const filterComp = ref<typeof ColumnFilter>() const filterComp = ref<typeof ColumnFilter>()
const { $e } = useNuxtApp()
const { nestedFilters } = useSmartsheetStoreOrThrow() const { nestedFilters } = useSmartsheetStoreOrThrow()
// todo: avoid duplicate api call by keeping a filter store // todo: avoid duplicate api call by keeping a filter store

4
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -350,7 +350,7 @@ useMenuCloseOnEsc(open)
No fields found No fields found
</div> </div>
<Draggable v-model="fields" item-key="id" @change="onMove($event)"> <Draggable v-model="fields" item-key="id" @change="onMove($event)">
<template #item="{ element: field, index: index }"> <template #item="{ element: field }">
<div <div
v-if=" v-if="
filteredFieldList filteredFieldList
@ -378,7 +378,7 @@ useMenuCloseOnEsc(open)
<span class="mt-0.65">{{ field.title }}</span> <span class="mt-0.65">{{ field.title }}</span>
</div> </div>
<NcSwitch :checked="field.show" v-e="['a:fields:show-hide']" :disabled="field.isViewEssentialField" /> <NcSwitch v-e="['a:fields:show-hide']" :checked="field.show" :disabled="field.isViewEssentialField" />
</div> </div>
<div class="flex-1" /> <div class="flex-1" />

14
packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue

@ -10,6 +10,7 @@ import {
inject, inject,
ref, ref,
useMenuCloseOnEsc, useMenuCloseOnEsc,
useNuxtApp,
useSmartsheetStoreOrThrow, useSmartsheetStoreOrThrow,
} from '#imports' } from '#imports'
@ -28,6 +29,8 @@ const isLocked = inject(IsLockedInj, ref(false))
const { gridViewCols, updateGridViewColumn } = useGridViewColumnOrThrow() const { gridViewCols, updateGridViewColumn } = useGridViewColumnOrThrow()
const { $e } = useNuxtApp()
const _groupBy = ref<{ fk_column_id?: string; sort: string; order: number }[]>([]) const _groupBy = ref<{ fk_column_id?: string; sort: string; order: number }[]>([])
const groupBy = computed<{ fk_column_id?: string; sort: string; order: number }[]>(() => { const groupBy = computed<{ fk_column_id?: string; sort: string; order: number }[]>(() => {
@ -106,6 +109,8 @@ const saveGroupBy = async () => {
} }
} }
$e('a:group-by:update', { groupBy: groupBy.value })
eventBus.emit(SmartsheetStoreEvents.GROUP_BY_RELOAD) eventBus.emit(SmartsheetStoreEvents.GROUP_BY_RELOAD)
} catch (e) { } catch (e) {
message.error('There was an error while updating view!') message.error('There was an error while updating view!')
@ -200,7 +205,13 @@ watch(open, () => {
</NcSelect> </NcSelect>
<a-tooltip placement="right" title="Remove"> <a-tooltip placement="right" title="Remove">
<NcButton class="nc-group-by-item-remove-btn" size="small" type="text" @click.stop="removeFieldFromGroupBy(i)"> <NcButton
v-e="['c:group-by:remove']"
class="nc-group-by-item-remove-btn"
size="small"
type="text"
@click.stop="removeFieldFromGroupBy(i)"
>
<GeneralIcon icon="delete" class="" /> <GeneralIcon icon="delete" class="" />
</NcButton> </NcButton>
</a-tooltip> </a-tooltip>
@ -208,6 +219,7 @@ watch(open, () => {
</div> </div>
<NcButton <NcButton
v-if="fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3" v-if="fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3"
v-e="['c:group-by:add']"
class="nc-add-group-btn" class="nc-add-group-btn"
style="width: fit-content" style="width: fit-content"
size="small" size="small"

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

@ -30,8 +30,6 @@ const { sorts, saveOrUpdate, loadSorts, addSort: _addSort, deleteSort } = useVie
const { showSystemFields, metaColumnById } = useViewColumns(view, meta) const { showSystemFields, metaColumnById } = useViewColumns(view, meta)
const removeIcon = ref<HTMLElement>()
const showCreateSort = ref(false) const showCreateSort = ref(false)
const { isMobileMode } = useGlobal() const { isMobileMode } = useGlobal()

3
packages/nc-gui/components/tabs/Smartsheet.vue

@ -54,9 +54,6 @@ const { isGallery, isGrid, isForm, isKanban, isLocked, isMap } = useProvideSmart
useSqlEditor() useSqlEditor()
const { openedProject } = storeToRefs(useProjects())
const { activeTable } = storeToRefs(useTablesStore())
const reloadEventHook = createEventHook<void | boolean>() const reloadEventHook = createEventHook<void | boolean>()
const reloadViewMetaEventHook = createEventHook<void | boolean>() const reloadViewMetaEventHook = createEventHook<void | boolean>()

1
packages/nc-gui/components/workspace/CollaboratorsList.vue

@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { OrderedWorkspaceRoles, RoleColors, RoleLabels, WorkspaceUserRoles } from 'nocodb-sdk' import { OrderedWorkspaceRoles, RoleColors, RoleLabels, WorkspaceUserRoles } from 'nocodb-sdk'
import { Empty } from 'ant-design-vue'
import { storeToRefs, stringToColour, timeAgo, useWorkspace } from '#imports' import { storeToRefs, stringToColour, timeAgo, useWorkspace } from '#imports'
const { user } = useGlobal() const { user } = useGlobal()

2
packages/nc-gui/components/workspace/CreateProjectDlg.vue

@ -15,7 +15,7 @@ const emit = defineEmits(['update:modelValue'])
const dialogShow = useVModel(props, 'modelValue', emit) const dialogShow = useVModel(props, 'modelValue', emit)
const projectsStore = useProjects() const projectsStore = useProjects()
const { loadProjects, createProject: _createProject } = projectsStore const { createProject: _createProject } = projectsStore
const { navigateToProject } = useGlobal() const { navigateToProject } = useGlobal()

7
packages/nc-gui/components/workspace/ProjectList.vue

@ -139,11 +139,6 @@ const workspaceMoveProjectOnSuccess = async (workspaceId: string) => {
}) })
} }
const moveProject = (project: ProjectType) => {
selectedProjectToMove.value = project
isMoveDlgOpen.value = true
}
const isDuplicateDlgOpen = ref(false) const isDuplicateDlgOpen = ref(false)
const selectedProjectToDuplicate = ref() const selectedProjectToDuplicate = ref()
@ -360,6 +355,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.duplicate') }} {{ $t('objects.project') }} {{ $t('general.duplicate') }} {{ $t('objects.project') }}
</div> </div>
</a-menu-item> </a-menu-item>
<!--
<a-menu-item <a-menu-item
v-if="false && isUIAllowed('moveProject', true, [record.workspace_role, record.project_role].join())" v-if="false && isUIAllowed('moveProject', true, [record.workspace_role, record.project_role].join())"
@click="moveProject(record)" @click="moveProject(record)"
@ -369,6 +365,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.move') }} {{ $t('objects.project') }} {{ $t('general.move') }} {{ $t('objects.project') }}
</div> </div>
</a-menu-item> </a-menu-item>
-->
<a-menu-item <a-menu-item
v-if="isUIAllowed('projectDelete', true, [record.workspace_role, record.project_role].join())" v-if="isUIAllowed('projectDelete', true, [record.workspace_role, record.project_role].join())"
@click="deleteProject(record)" @click="deleteProject(record)"

2
packages/nc-gui/components/workspace/View.vue

@ -10,8 +10,6 @@ const workspaceStore = useWorkspace()
const { isWorkspaceOwnerOrCreator, isWorkspaceOwner, activeWorkspace, workspaces } = storeToRefs(workspaceStore) const { isWorkspaceOwnerOrCreator, isWorkspaceOwner, activeWorkspace, workspaces } = storeToRefs(workspaceStore)
const { loadCollaborators } = workspaceStore const { loadCollaborators } = workspaceStore
const { appInfo } = useGlobal()
const tab = computed({ const tab = computed({
get() { get() {
return route.value.query?.tab ?? 'collaborators' return route.value.query?.tab ?? 'collaborators'

4
packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index.vue

@ -9,10 +9,6 @@ useProjectsShortcuts()
provide(TabMetaInj, activeTab) provide(TabMetaInj, activeTab)
useSidebar('nc-left-sidebar') useSidebar('nc-left-sidebar')
const router = useRouter()
const route = router.currentRoute
</script> </script>
<template> <template>

2
packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index/[viewId]/[[viewTitle]]/[...slugs].vue

@ -1 +1 @@
<template></template> <template><span /></template>

7
packages/nc-gui/utils/iconUtils.ts

@ -32,25 +32,19 @@ import MaterialSymbolsWarningOutlineRounded from '~icons/material-symbols/warnin
import MaterialSymbolsDragIndicator from '~icons/ri/draggable' import MaterialSymbolsDragIndicator from '~icons/ri/draggable'
import NcSearch from '~icons/nc-icons/search' import NcSearch from '~icons/nc-icons/search'
import NcCreditCard from '~icons/nc-icons/credit-card' import NcCreditCard from '~icons/nc-icons/credit-card'
import NcLayers from '~icons/nc-icons/layers' import NcLayers from '~icons/nc-icons/layers'
import NcUsers from '~icons/nc-icons/users' import NcUsers from '~icons/nc-icons/users'
import NcCheck from '~icons/nc-icons/check' import NcCheck from '~icons/nc-icons/check'
import PlusSquare from '~icons/nc-icons/plus-square' import PlusSquare from '~icons/nc-icons/plus-square'
import PhLayout from '~icons/ph/layout' import PhLayout from '~icons/ph/layout'
import Copy from '~icons/material-symbols/content-copy-outline'
import Delete from '~icons/material-symbols/delete-outline-rounded' import Delete from '~icons/material-symbols/delete-outline-rounded'
import CiFilter from '~icons/mdi/filter-outline' import CiFilter from '~icons/mdi/filter-outline'
import Plus from '~icons/material-symbols/add-rounded'
import Minus from '~icons/material-symbols/remove-rounded' import Minus from '~icons/material-symbols/remove-rounded'
import Code from '~icons/material-symbols/code-rounded' import Code from '~icons/material-symbols/code-rounded'
import Palette from '~icons/material-symbols/palette-outline' import Palette from '~icons/material-symbols/palette-outline'
import Erd from '~icons/material-symbols/account-tree-outline-rounded'
import MsSync from '~icons/material-symbols/sync-rounded' import MsSync from '~icons/material-symbols/sync-rounded'
import MdiRefresh from '~icons/mdi/refresh' import MdiRefresh from '~icons/mdi/refresh'
import ApiSnippet from '~icons/material-symbols/settings-ethernet-rounded' import ApiSnippet from '~icons/material-symbols/settings-ethernet-rounded'
import MdiSettings from '~icons/mdi/cog-outline'
import Phishing from '~icons/material-symbols/phishing-outline-rounded' import Phishing from '~icons/material-symbols/phishing-outline-rounded'
import MdiAccountGroup from '~icons/mdi/account-group' import MdiAccountGroup from '~icons/mdi/account-group'
import MdiDotsVertical from '~icons/mdi/dots-vertical' import MdiDotsVertical from '~icons/mdi/dots-vertical'
@ -70,7 +64,6 @@ import NcIconsRowHeightExtraTall from '~icons/nc-icons/row-height-extra-tall'
import MsInfo from '~icons/material-symbols/info-outline-rounded' import MsInfo from '~icons/material-symbols/info-outline-rounded'
import PhSparkleFill from '~icons/ph/sparkle-fill' import PhSparkleFill from '~icons/ph/sparkle-fill'
import NcArticle from '~icons/nc-icons/article' import NcArticle from '~icons/nc-icons/article'
import MsDatabase from '~icons/mdi/database-outline' import MsDatabase from '~icons/mdi/database-outline'
import MdiDatabaseSearch from '~icons/mdi/database-search' import MdiDatabaseSearch from '~icons/mdi/database-search'
import MdiMagicStaff from '~icons/mdi/magic-staff' import MdiMagicStaff from '~icons/mdi/magic-staff'

2
packages/nocodb/src/Noco.ts

@ -18,8 +18,6 @@ import type { Express } from 'express';
import type http from 'http'; import type http from 'http';
import { MetaTable } from '~/utils/globals'; import { MetaTable } from '~/utils/globals';
import Store from '~/models/Store';
import { NC_LICENSE_KEY } from '~/constants';
import { AppModule } from '~/app.module'; import { AppModule } from '~/app.module';
import { isEE } from '~/utils'; import { isEE } from '~/utils';

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -2176,7 +2176,7 @@ class BaseModelSqlv2 {
return res; return res;
} }
async updateByPk(id, data, trx?, cookie?, disableOptimization = false) { async updateByPk(id, data, trx?, cookie?, _disableOptimization = false) {
try { try {
const updateObj = await this.model.mapAliasToColumn( const updateObj = await this.model.mapAliasToColumn(
data, data,

2
packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

@ -768,7 +768,7 @@ async function _formulaQueryBuilder(
} else if (pt.type === 'Literal') { } else if (pt.type === 'Literal') {
return { builder: knex.raw(`?${colAlias}`, [pt.value]) }; return { builder: knex.raw(`?${colAlias}`, [pt.value]) };
} else if (pt.type === 'Identifier') { } else if (pt.type === 'Identifier') {
const { builder } = await aliasToColumn?.[pt.name]?.(); const { builder } = (await aliasToColumn?.[pt.name]?.()) || {};
if (typeof builder === 'function') { if (typeof builder === 'function') {
return { builder: knex.raw(`??${colAlias}`, builder(pt.fnName)) }; return { builder: knex.raw(`??${colAlias}`, builder(pt.fnName)) };
} }

2
packages/nocodb/src/plugins/discord/Discord.ts

@ -7,7 +7,7 @@ export default class Discord implements IWebhookNotificationAdapter {
} }
public async sendMessage(content: string, payload: any): Promise<any> { public async sendMessage(content: string, payload: any): Promise<any> {
for (const { webhook_url } of payload?.channels) { for (const { webhook_url } of payload?.channels || []) {
try { try {
return await axios.post(webhook_url, { return await axios.post(webhook_url, {
content, content,

2
packages/nocodb/src/plugins/mattermost/Mattermost.ts

@ -7,7 +7,7 @@ export default class Mattermost implements IWebhookNotificationAdapter {
} }
public async sendMessage(text: string, payload: any): Promise<any> { public async sendMessage(text: string, payload: any): Promise<any> {
for (const { webhook_url } of payload?.channels) { for (const { webhook_url } of payload?.channels || []) {
try { try {
return await axios.post(webhook_url, { return await axios.post(webhook_url, {
text, text,

2
packages/nocodb/src/plugins/slack/Slack.ts

@ -7,7 +7,7 @@ export default class Slack implements IWebhookNotificationAdapter {
} }
public async sendMessage(text: string, payload: any): Promise<any> { public async sendMessage(text: string, payload: any): Promise<any> {
for (const { webhook_url } of payload?.channels) { for (const { webhook_url } of payload?.channels || []) {
try { try {
return await axios.post(webhook_url, { return await axios.post(webhook_url, {
text, text,

2
packages/nocodb/src/plugins/teams/Teams.ts

@ -7,7 +7,7 @@ export default class Teams implements IWebhookNotificationAdapter {
} }
public async sendMessage(Text: string, payload: any): Promise<any> { public async sendMessage(Text: string, payload: any): Promise<any> {
for (const { webhook_url } of payload?.channels) { for (const { webhook_url } of payload?.channels || []) {
try { try {
return await axios.post(webhook_url, { return await axios.post(webhook_url, {
Text, Text,

2
packages/nocodb/src/plugins/twilio/Twilio.ts

@ -14,7 +14,7 @@ export default class Twilio implements IWebhookNotificationAdapter {
} }
public async sendMessage(content: string, payload: any): Promise<any> { public async sendMessage(content: string, payload: any): Promise<any> {
for (const num of payload?.to?.split(/\s*?,\s*?/)) { for (const num of payload?.to?.split(/\s*?,\s*?/) || []) {
try { try {
await this.client.messages.create({ await this.client.messages.create({
body: content, body: content,

2
packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsapp.ts

@ -14,7 +14,7 @@ export default class TwilioWhatsapp implements IWebhookNotificationAdapter {
} }
public async sendMessage(content: string, payload: any): Promise<any> { public async sendMessage(content: string, payload: any): Promise<any> {
for (const num of payload?.to?.split(/\s*?,\s*?/)) { for (const num of payload?.to?.split(/\s*?,\s*?/) || []) {
try { try {
await this.client.messages.create({ await this.client.messages.create({
body: content, body: content,

2
packages/nocodb/src/services/api-docs/swagger/templates/params.ts

@ -1,4 +1,4 @@
import { isLinksOrLTAR, RelationTypes, UITypes } from 'nocodb-sdk' import { isLinksOrLTAR, RelationTypes, UITypes } from 'nocodb-sdk';
import type { LinkToAnotherRecordColumn } from '~/models'; import type { LinkToAnotherRecordColumn } from '~/models';
import type { SwaggerColumn } from '../getSwaggerColumnMetas'; import type { SwaggerColumn } from '../getSwaggerColumnMetas';

2
packages/nocodb/src/services/api-docs/swagger/templates/paths.ts

@ -1,4 +1,4 @@
import { isLinksOrLTAR, ModelTypes, UITypes } from 'nocodb-sdk'; import { isLinksOrLTAR, ModelTypes } from 'nocodb-sdk';
import { import {
columnNameParam, columnNameParam,
columnNameQueryParam, columnNameQueryParam,

8
packages/nocodb/src/services/tables.service.ts

@ -1,6 +1,12 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import DOMPurify from 'isomorphic-dompurify'; import DOMPurify from 'isomorphic-dompurify';
import { isLinksOrLTAR, isVirtualCol, ModelTypes, ProjectRoles, UITypes } from 'nocodb-sdk' import {
isLinksOrLTAR,
isVirtualCol,
ModelTypes,
ProjectRoles,
UITypes,
} from 'nocodb-sdk';
import { AppEvents } from 'nocodb-sdk'; import { AppEvents } from 'nocodb-sdk';
import { MetaDiffsService } from './meta-diffs.service'; import { MetaDiffsService } from './meta-diffs.service';
import { ColumnsService } from './columns.service'; import { ColumnsService } from './columns.service';

Loading…
Cancel
Save