mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 16:36:58 +00:00
Nc org chart extension (#9860)
* feat(extensions): org chart: working nodes and edges * fix(extensions): org chart: auto select active view * fix(extensions): org chart: reuse isValidValue * fix(extensions): org chart: typing and linting * fix(extensions): org chart: fix edge case --------- Co-authored-by: amandesai01 <amandesai01@gmail.com>
This commit is contained in:
@@ -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,13 +140,10 @@ export const rowDefaultData = (columns: ColumnType[] = []) => {
|
||||
return defaultData
|
||||
}
|
||||
|
||||
export const isRowEmpty = (record: any, col: any) => {
|
||||
if (!record || !col) return true
|
||||
export const isRowEmpty = (record: Pick<Row, 'row'>, col: ColumnType): boolean => {
|
||||
if (!record || !col || !col.title) return true
|
||||
|
||||
const val = record.row[col.title]
|
||||
if (val === null || val === undefined || val === '') return true
|
||||
|
||||
return Array.isArray(val) && val.length === 0
|
||||
return !isValidValue(record.row[col.title])
|
||||
}
|
||||
|
||||
export function validateRowFilters(_filters: FilterType[], data: any, columns: ColumnType[], client: any) {
|
||||
|
||||
Reference in New Issue
Block a user