Browse Source

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

amandesai01 4 days 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
loading?: boolean
suffixIcon?: keyof typeof iconMap
maxTagCount?: number
}>(),
{
suffixIcon: 'arrowDown',
@ -45,16 +46,17 @@ const onChange = (value: string) => {
<template>
<a-select
v-model:value="vModel"
:size="size"
:allow-clear="allowClear"
:size
:allow-clear
:disabled="loading"
:dropdown-class-name="dropdownClassName"
:dropdown-match-select-width="dropdownMatchSelectWidth"
:filter-option="filterOption"
:loading="loading"
:mode="mode"
:placeholder="placeholder"
:show-search="showSearch"
:dropdown-class-name
:dropdown-match-select-width
:filter-option
:loading
:mode
:placeholder
:show-search
:max-tag-count
class="nc-select"
@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 dayjs from 'dayjs'
import { isColumnRequiredAndNull } from './columnUtils'
import type { Row } from '~/lib/types'
export const isValidValue = (val: unknown) => {
if (ncIsNull(val) || ncIsUndefined(val)) {
@ -141,10 +140,19 @@ export const rowDefaultData = (columns: ColumnType[] = []) => {
return defaultData
}
export const isRowEmpty = (record: any, col: any) => {
export const isRowEmpty = (record: Row, col: ColumnType) => {
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
return Array.isArray(val) && val.length === 0

Loading…
Cancel
Save