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. 14
      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

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

@ -1,6 +1,6 @@
<script setup lang="ts">
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<{
modelValue?: string | number
@ -91,16 +91,16 @@ onClickOutside(inputWrapperRef, (e) => {
<div
v-if="active"
class="!absolute right-0 bottom-0 h-6 w-5 group cursor-pointer flex justify-end gap-1 items-center active:(ring ring-accent ring-opacity-100) rounded border-none p-1 hover:(bg-primary bg-opacity-10) dark:(!bg-slate-500)"
:class="{'right-2 bottom-2':editEnabled}"
:class="{ 'right-2 bottom-2': editEnabled }"
data-testid="attachment-cell-file-picker-button"
@click.stop="isVisible = !isVisible"
>
<NcTooltip placement="bottom">
<template #title>Expand</template>
<component
:is="iconMap.expand"
class="transform dark:(!text-white) group-hover:(!text-grey-800 scale-120) text-gray-500 text-xs"
/>
<template #title>Expand</template>
<component
:is="iconMap.expand"
class="transform dark:(!text-white) group-hover:(!text-grey-800 scale-120) text-gray-500 text-xs"
/>
</NcTooltip>
</div>
</div>

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

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { onKeyDown } from '@vueuse/core'
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()!

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

@ -1,5 +1,4 @@
import type { AttachmentType } from 'nocodb-sdk'
import { readonly } from '@vue/reactivity'
import RenameFile from './RenameFile.vue'
import {
ColumnInj,
@ -34,8 +33,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
(updateModelValue: (data: string | Record<string, any>[]) => void) => {
const isReadonly = inject(ReadonlyInj, ref(false))
const isLockedMode = inject(IsLockedInj, ref(false))
const isPublic = inject(IsPublicInj, 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">
const workspaceStore = useWorkspace()
const projectStore = useProject()
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isSharedBase } = storeToRefs(projectStore)
const { activeWorkspace, isWorkspaceLoading } = storeToRefs(workspaceStore)
</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>
</a-menu-item>
</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>

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

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

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

@ -1,5 +1,5 @@
<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 { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports'
import {
@ -423,43 +423,6 @@ watch(
<a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" />
</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>
<!-- Host Address -->
<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-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>
<!-- Host Address -->
<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,
ref,
storeToRefs,
useGlobal,
useNuxtApp,
useProject,
watch,

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

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

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

@ -3,7 +3,6 @@ import {
Form,
TabType,
computed,
iconMap,
nextTick,
onMounted,
ref,
@ -153,25 +152,7 @@ onMounted(() => {
:placeholder="$t('msg.info.enterTableName')"
/>
</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 }">
<!-- 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 class="mb-1">
<!-- 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 { ViewTypes } from 'nocodb-sdk'
import tinycolor from 'tinycolor2'
import { useTablesStore } from '~/store/tables'
import { useMetas } from '~/composables/useMetas'
import { useMetas } from '#imports'
const { view: _view, $api } = useSmartsheetStoreOrThrow()
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<{
isViewToolbar?: boolean
}>()
const router = useRouter()
const route = router.currentRoute
const { copy } = useCopy()
const { dashboardUrl } = useDashboard()

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

@ -52,11 +52,6 @@ onKeyStroke('Enter', () => {
<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">
<NcButton type="secondary" @click="visible = false">
{{ $t('general.cancel') }}

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

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

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

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

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

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

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

@ -115,15 +115,6 @@ watch(
</template>
<DashboardSettingsDataSources v-model:state="baseSettingsState" />
</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>
</div>
</div>

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

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

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

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

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

@ -1,7 +1,7 @@
<script setup lang="ts">
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))

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

@ -1,5 +1,5 @@
<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()
@ -12,10 +12,6 @@ const { isViewsLoading } = storeToRefs(useViewsStore())
const { isMobileMode } = useGlobal()
const { isUIAllowed } = useUIPermission()
const { allowCSVDownload } = useSharedView()
const isSharedBase = computed(() => route.value.params.typeOrId === 'base')
</script>

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

@ -3,13 +3,11 @@ import type ColumnFilter from './ColumnFilter.vue'
import {
ActiveViewInj,
IsLockedInj,
IsPublicInj,
computed,
inject,
ref,
useGlobal,
useMenuCloseOnEsc,
useNuxtApp,
useSmartsheetStoreOrThrow,
useViewFilters,
watch,
@ -21,14 +19,10 @@ const isLocked = inject(IsLockedInj, ref(false))
const activeView = inject(ActiveViewInj, ref())
const isPublic = inject(IsPublicInj, ref(false))
const { filterAutoSave, isMobileMode } = useGlobal()
const filterComp = ref<typeof ColumnFilter>()
const { $e } = useNuxtApp()
const { nestedFilters } = useSmartsheetStoreOrThrow()
// 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
</div>
<Draggable v-model="fields" item-key="id" @change="onMove($event)">
<template #item="{ element: field, index: index }">
<template #item="{ element: field }">
<div
v-if="
filteredFieldList
@ -378,7 +378,7 @@ useMenuCloseOnEsc(open)
<span class="mt-0.65">{{ field.title }}</span>
</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 class="flex-1" />

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

@ -10,6 +10,7 @@ import {
inject,
ref,
useMenuCloseOnEsc,
useNuxtApp,
useSmartsheetStoreOrThrow,
} from '#imports'
@ -28,6 +29,8 @@ const isLocked = inject(IsLockedInj, ref(false))
const { gridViewCols, updateGridViewColumn } = useGridViewColumnOrThrow()
const { $e } = useNuxtApp()
const _groupBy = ref<{ 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)
} catch (e) {
message.error('There was an error while updating view!')
@ -200,7 +205,13 @@ watch(open, () => {
</NcSelect>
<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="" />
</NcButton>
</a-tooltip>
@ -208,6 +219,7 @@ watch(open, () => {
</div>
<NcButton
v-if="fieldsToGroupBy.length > _groupBy.length && _groupBy.length < 3"
v-e="['c:group-by:add']"
class="nc-add-group-btn"
style="width: fit-content"
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 removeIcon = ref<HTMLElement>()
const showCreateSort = ref(false)
const { isMobileMode } = useGlobal()

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

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

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

@ -1,6 +1,5 @@
<script lang="ts" setup>
import { OrderedWorkspaceRoles, RoleColors, RoleLabels, WorkspaceUserRoles } from 'nocodb-sdk'
import { Empty } from 'ant-design-vue'
import { storeToRefs, stringToColour, timeAgo, useWorkspace } from '#imports'
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 projectsStore = useProjects()
const { loadProjects, createProject: _createProject } = projectsStore
const { createProject: _createProject } = projectsStore
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 selectedProjectToDuplicate = ref()
@ -360,6 +355,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.duplicate') }} {{ $t('objects.project') }}
</div>
</a-menu-item>
<!--
<a-menu-item
v-if="false && isUIAllowed('moveProject', true, [record.workspace_role, record.project_role].join())"
@click="moveProject(record)"
@ -369,6 +365,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.move') }} {{ $t('objects.project') }}
</div>
</a-menu-item>
-->
<a-menu-item
v-if="isUIAllowed('projectDelete', true, [record.workspace_role, record.project_role].join())"
@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 { loadCollaborators } = workspaceStore
const { appInfo } = useGlobal()
const tab = computed({
get() {
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)
useSidebar('nc-left-sidebar')
const router = useRouter()
const route = router.currentRoute
</script>
<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 NcSearch from '~icons/nc-icons/search'
import NcCreditCard from '~icons/nc-icons/credit-card'
import NcLayers from '~icons/nc-icons/layers'
import NcUsers from '~icons/nc-icons/users'
import NcCheck from '~icons/nc-icons/check'
import PlusSquare from '~icons/nc-icons/plus-square'
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 CiFilter from '~icons/mdi/filter-outline'
import Plus from '~icons/material-symbols/add-rounded'
import Minus from '~icons/material-symbols/remove-rounded'
import Code from '~icons/material-symbols/code-rounded'
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 MdiRefresh from '~icons/mdi/refresh'
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 MdiAccountGroup from '~icons/mdi/account-group'
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 PhSparkleFill from '~icons/ph/sparkle-fill'
import NcArticle from '~icons/nc-icons/article'
import MsDatabase from '~icons/mdi/database-outline'
import MdiDatabaseSearch from '~icons/mdi/database-search'
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 { MetaTable } from '~/utils/globals';
import Store from '~/models/Store';
import { NC_LICENSE_KEY } from '~/constants';
import { AppModule } from '~/app.module';
import { isEE } from '~/utils';

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

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

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

@ -768,7 +768,7 @@ async function _formulaQueryBuilder(
} else if (pt.type === 'Literal') {
return { builder: knex.raw(`?${colAlias}`, [pt.value]) };
} else if (pt.type === 'Identifier') {
const { builder } = await aliasToColumn?.[pt.name]?.();
const { builder } = (await aliasToColumn?.[pt.name]?.()) || {};
if (typeof builder === 'function') {
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> {
for (const { webhook_url } of payload?.channels) {
for (const { webhook_url } of payload?.channels || []) {
try {
return await axios.post(webhook_url, {
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> {
for (const { webhook_url } of payload?.channels) {
for (const { webhook_url } of payload?.channels || []) {
try {
return await axios.post(webhook_url, {
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> {
for (const { webhook_url } of payload?.channels) {
for (const { webhook_url } of payload?.channels || []) {
try {
return await axios.post(webhook_url, {
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> {
for (const { webhook_url } of payload?.channels) {
for (const { webhook_url } of payload?.channels || []) {
try {
return await axios.post(webhook_url, {
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> {
for (const num of payload?.to?.split(/\s*?,\s*?/)) {
for (const num of payload?.to?.split(/\s*?,\s*?/) || []) {
try {
await this.client.messages.create({
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> {
for (const num of payload?.to?.split(/\s*?,\s*?/)) {
for (const num of payload?.to?.split(/\s*?,\s*?/) || []) {
try {
await this.client.messages.create({
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 { 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 {
columnNameParam,
columnNameQueryParam,

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

@ -1,6 +1,12 @@
import { Injectable } from '@nestjs/common';
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 { MetaDiffsService } from './meta-diffs.service';
import { ColumnsService } from './columns.service';

Loading…
Cancel
Save