Browse Source

feat(extensions): org chart: working nodes and edges

amandesai01 10 hours ago
parent
commit
2b61e18419
  1. 20
      packages/nc-gui/components/nc/Select.vue
  2. 14
      packages/nc-gui/utils/dataUtils.ts

20
packages/nc-gui/components/nc/Select.vue

@ -15,6 +15,7 @@ const props = withDefaults(
allowClear?: boolean allowClear?: boolean
loading?: boolean loading?: boolean
suffixIcon?: keyof typeof iconMap suffixIcon?: keyof typeof iconMap
maxTagCount?: number
}>(), }>(),
{ {
suffixIcon: 'arrowDown', suffixIcon: 'arrowDown',
@ -45,16 +46,17 @@ const onChange = (value: string) => {
<template> <template>
<a-select <a-select
v-model:value="vModel" v-model:value="vModel"
:size="size" :size
:allow-clear="allowClear" :allow-clear
:disabled="loading" :disabled="loading"
:dropdown-class-name="dropdownClassName" :dropdown-class-name
:dropdown-match-select-width="dropdownMatchSelectWidth" :dropdown-match-select-width
:filter-option="filterOption" :filter-option
:loading="loading" :loading
:mode="mode" :mode
:placeholder="placeholder" :placeholder
:show-search="showSearch" :show-search
:max-tag-count
class="nc-select" class="nc-select"
@change="onChange" @change="onChange"
> >

14
packages/nc-gui/utils/dataUtils.ts

@ -2,7 +2,6 @@ import { RelationTypes, UITypes, buildFilterTree, isDateMonthFormat, isSystemCol
import type { ColumnType, FilterType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import type { ColumnType, FilterType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { isColumnRequiredAndNull } from './columnUtils' import { isColumnRequiredAndNull } from './columnUtils'
import type { Row } from '~/lib/types'
export const isValidValue = (val: unknown) => { export const isValidValue = (val: unknown) => {
if (ncIsNull(val) || ncIsUndefined(val)) { if (ncIsNull(val) || ncIsUndefined(val)) {
@ -141,10 +140,19 @@ export const rowDefaultData = (columns: ColumnType[] = []) => {
return defaultData return defaultData
} }
export const isRowEmpty = (record: any, col: any) => { export const isRowEmpty = (record: Row, col: ColumnType) => {
if (!record || !col) return true if (!record || !col) return true
const val = record.row[col.title] const val = record.row[col.title!]
if (val === null || val === undefined || val === '') return true
return Array.isArray(val) && val.length === 0
}
export const isRowRecordEmpty = (record: Record<string, any>, col: ColumnType) => {
if (!record || !col) return true
const val = record[col.title!]
if (val === null || val === undefined || val === '') return true if (val === null || val === undefined || val === '') return true
return Array.isArray(val) && val.length === 0 return Array.isArray(val) && val.length === 0

Loading…
Cancel
Save