Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6db2d95
fix(nc-gui): guard form view actions against undefined active view
rameshmane7218 May 20, 2026
aaf9056
fix(nc-gui): guard breakpoint watcher against null document.body
rameshmane7218 May 20, 2026
b61ca1f
fix(nc-gui): null-safe BookmarksMenuAction props in ViewActionMenu
rameshmane7218 May 20, 2026
8ae5cfc
refactor(nc-gui): guard BookmarksMenuAction with v-if instead of opti…
rameshmane7218 May 20, 2026
962c4b6
refactor(nc-gui): guard BookmarksMenuAction with isPublicView check
rameshmane7218 May 20, 2026
3e74585
fix(nc-gui): null-safe label in field list filterOption
rameshmane7218 May 20, 2026
5ba7453
fix(nc-gui): guard isUnicodeEmoji against non-string input
rameshmane7218 May 20, 2026
3676b1a
fix(nc-gui): guard atLeastOneEnabledValidation against missing table key
rameshmane7218 May 20, 2026
a38de14
fix(nocodb-sdk): null-safe value access in getPlaceholderNewRow
rameshmane7218 May 20, 2026
3986179
fix(nc-gui): type-check modelValue before trim in SingleSelect Readonly
rameshmane7218 May 20, 2026
fbcb024
fix(nc-gui): handle orphan column reference in form filter validation
rameshmane7218 May 20, 2026
05cd606
fix(nc-gui): skip rendering ItemChip when column prop is undefined
rameshmane7218 May 20, 2026
836b60f
fix(nc-gui): guard against undefined entries in lookup column find
rameshmane7218 May 20, 2026
8922d0a
fix(nc-gui): bound CSV detectColumnType loop by header length
rameshmane7218 May 20, 2026
fe23ec3
fix(nc-gui): guard Lookup canvas renderer against missing tableMetaLo…
rameshmane7218 May 20, 2026
75908b2
Merge pull request #13874 from nocodb/nc-fix/sentry-errors-19th-may
DarkPhoenix2704 May 20, 2026
8ac7689
feat(nc-gui): dashboard chart color palette picker
rameshmane7218 May 20, 2026
b32a408
refactor(nc-gui): consolidate chart palette into appearance.colorSchema
rameshmane7218 May 20, 2026
26a5106
fix(nc-gui): i18n chart palette picker labels
rameshmane7218 May 20, 2026
6e85b98
Merge pull request #13875 from nocodb/nc-feat/dashboard-chart-color-s…
DarkPhoenix2704 May 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nc-gui/components/cell/SingleSelect/Readonly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const optionsMap = computed(() => {
})

const selectedOpt = computed(() => {
return modelValue ? optionsMap.value[modelValue?.trim()] : undefined
return typeof modelValue === 'string' ? optionsMap.value[modelValue.trim()] : undefined
})
</script>

Expand Down
4 changes: 2 additions & 2 deletions packages/nc-gui/components/smartsheet/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function onMoveCallback(event: any) {
}

async function onMove(event: any, isVisibleFormFields = false) {
if (isLocked.value || !isEditable) return
if (isLocked.value || !isEditable || !view.value) return

let { newIndex, element } = event.moved

Expand Down Expand Up @@ -766,7 +766,7 @@ async function onFieldMoveToNewRow(event: any, beforeRowKey?: string) {
}

async function showOrHideColumn(column: Record<string, any>, show: boolean, isFormSettings = false) {
if (isLocked.value || !isEditable) return
if (isLocked.value || !isEditable || !view.value) return

if (shouldSkipColumn(column)) {
// Required field can't be moved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const LookupCellRenderer: CellRenderer = {
const relatedModelId = relatedColOptions.fk_related_model_id
if (!relatedModelId) return

if (tableMetaLoader.isLoading(relatedModelId, relatedBaseId)) return
if (!tableMetaLoader || tableMetaLoader.isLoading(relatedModelId, relatedBaseId)) return

tableMetaLoader.getTableMeta(relatedModelId, relatedBaseId)

Expand Down Expand Up @@ -164,7 +164,7 @@ export const LookupCellRenderer: CellRenderer = {
// Restore canvas context before returning — ctx.save()/ctx.clip() was already called above
ctx.restore()

if (tableMetaLoader.isLoading(lkRelatedModelId, lkRelatedBaseId)) return
if (!tableMetaLoader || tableMetaLoader.isLoading(lkRelatedModelId, lkRelatedBaseId)) return

tableMetaLoader.getTableMeta(lkRelatedModelId, lkRelatedBaseId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const options = computed<SelectProps['options']>(() =>
})),
)

const filterOption = (input: string, option: any) => option.label.toLowerCase()?.includes(input.toLowerCase())
const filterOption = (input: string, option: any) => option.label?.toLowerCase()?.includes(input.toLowerCase())

// when a new filter is created, select a field by default
if (!localValue.value && allowEmpty !== true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ defineOptions({
</template>

<BookmarksMenuAction
v-if="isEeUI"
v-if="isEeUI && !isPublicView"
target-type="view"
:target-id="view.id!"
:meta="{ view_type: view.type, workspace_id: base.fk_workspace_id, base_id: table.base_id, table_id: table.id }"
Expand Down
2 changes: 1 addition & 1 deletion packages/nc-gui/components/template/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function missingRequiredColumnsValidation(tn: string, showError = false) {
}

function atLeastOneEnabledValidation(tn: string, showError = false) {
if (srcDestMapping.value[tn].filter((v: Record<string, any>) => v.enabled === true).length === 0) {
if ((srcDestMapping.value[tn] || []).filter((v: Record<string, any>) => v.enabled === true).length === 0) {
const err = t('msg.error.selectAtleastOneColumn')
if (showError) {
message.error(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export default {

<template>
<div
v-if="column"
v-e="['c:row-expand:open']"
class="chip group mr-1 my-0.5 flex items-center rounded-[2px] flex-row"
:class="{ active, 'border-1 py-1 px-2': isAttachment(column), truncate, 'cursor-pointer': !isClickDisabled }"
Expand Down
3 changes: 2 additions & 1 deletion packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export default class CSVTemplateAdapter {
}

detectColumnType(tableIdx: number, data: []) {
for (let columnIdx = 0; columnIdx < data.length; columnIdx++) {
const columnCount = this.headers[tableIdx]?.length ?? 0
for (let columnIdx = 0; columnIdx < Math.min(data.length, columnCount); columnIdx++) {
// skip null data
if (!data[columnIdx]) continue
const colData: any = [data[columnIdx]]
Expand Down
9 changes: 9 additions & 0 deletions packages/nc-gui/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,15 @@
"apply": "Apply",
"text": "Text",
"appearance": "Appearance",
"colorPalette": "Color palette",
"chartPalette": {
"default": "Default",
"classic": "Classic",
"vibrant": "Vibrant",
"pastel": "Pastel",
"earth": "Earth",
"monoBlue": "Mono Blue"
},
"now": "Now",
"set": "Set",
"format": "Format",
Expand Down
69 changes: 52 additions & 17 deletions packages/nc-gui/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,60 @@ export const NC_CLOUD_URL = 'https://app.nocodb.com'

export const clientMousePositionDefaultValue = { clientX: 0, clientY: 0 }

// NocoDB-branded categorical palette for dashboard widgets.
// Leads with brand blue (#3366ff) and steps ~30° around the wheel so
// adjacent slices stay distinguishable. Saturation/lightness tuned to
// feel calm rather than the loud default ECharts rainbow.
export const CHART_COLORS = [
'#3366FF', // brand blue
'#36BFFF', // sky
'#22C7C9', // teal
'#22C55E', // green
'#FFCD56', // amber
'#FFA94D', // warm orange
'#FF6B6B', // coral
'#FF6B9D', // pink
'#B388EB', // soft purple
'#7C8FFF', // periwinkle
'#94A3B8', // slate
'#67E8F9', // light cyan
// Curated palettes keyed by the chart appearance.colorSchema enum value.
// 'default' is the NocoDB brand palette (current product default).
// 'custom' is reserved — when wired, it consumes appearance.customColorSchema.
export const CHART_PALETTES: Record<string, string[]> = {
default: [
'#3366FF', '#36BFFF', '#22C7C9', '#22C55E',
'#FFCD56', '#FFA94D', '#FF6B6B', '#FF6B9D',
'#B388EB', '#7C8FFF', '#94A3B8', '#67E8F9',
],
classic: [
'#4E79A7', '#F28E2B', '#E15759', '#76B7B2',
'#59A14F', '#EDC948', '#B07AA1', '#9C755F',
'#FF9DA7', '#BAB0AC',
],
vibrant: [
'#7C3AED', '#EC4899', '#F59E0B', '#10B981',
'#0EA5E9', '#EF4444', '#14B8A6', '#A855F7',
'#F97316', '#22D3EE',
],
pastel: [
'#A5B4FC', '#FCA5A5', '#FCD34D', '#86EFAC',
'#67E8F9', '#F9A8D4', '#FDBA74', '#C4B5FD',
'#FECACA', '#BBF7D0',
],
earth: [
'#8B4513', '#CD853F', '#DAA520', '#6B8E23',
'#A0522D', '#D2691E', '#BC8F8F', '#556B2F',
'#8FBC8F', '#B8860B',
],
monoBlue: [
'#0B2D7A', '#1E40AF', '#2563EB', '#3B82F6',
'#60A5FA', '#93C5FD', '#BFDBFE', '#DBEAFE',
],
}

// `value` is the colorSchema enum value (also the i18n key suffix under
// labels.chartPalette.*). Components resolve the display label via t().
export const CHART_PALETTE_OPTIONS = [
{ value: 'default', colors: CHART_PALETTES.default },
{ value: 'classic', colors: CHART_PALETTES.classic },
{ value: 'vibrant', colors: CHART_PALETTES.vibrant },
{ value: 'pastel', colors: CHART_PALETTES.pastel },
{ value: 'earth', colors: CHART_PALETTES.earth },
{ value: 'monoBlue', colors: CHART_PALETTES.monoBlue },
]

export const getChartColors = (schema?: string | null): string[] => {
return CHART_PALETTES[schema ?? 'default'] ?? CHART_PALETTES.default!
}

// Legacy named export kept for any remaining consumer; resolves to the
// default (brand) palette. New chart code reads getChartColors(appearance.colorSchema).
export const CHART_COLORS = CHART_PALETTES.default!

/** Virtual section ID for views not assigned to any real section */
export const DEFAULT_SECTION_ID = '__default__'

Expand Down
11 changes: 6 additions & 5 deletions packages/nc-gui/lib/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,13 @@ export class FormFilters {

if (filter.is_group) {
res = await this.validateCondition(filter.children, parentCol, errors)
} else {
if (!filter.fk_column_id || !this.formViewColumnsMapByFkColumnId[filter.fk_column_id]) {
res = false
} else if (!filter.fk_column_id || !this.formViewColumnsMapByFkColumnId[filter.fk_column_id]) {
if (filter.fk_column_id) {
errors[filter.fk_column_id] = `Condition references a field that no longer exists in the form.`
}

const column = this.formViewColumnsMapByFkColumnId[filter.fk_column_id]
res = false
} else {
const column = this.formViewColumnsMapByFkColumnId[filter.fk_column_id]!
// If the filter condition col is below parent column then this will be invalid condition so return false
if (!this.isFieldAboveParentColumn(column, parentCol)) {
errors[column.fk_column_id] = `Condition references a field (${column.title}) that comes later in the form.`
Expand Down
2 changes: 2 additions & 0 deletions packages/nc-gui/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const useConfigStore = defineStore('configStore', () => {
globalIsMobile.value = isMobileMode.value
globalActiveBreakpoint.value = bp

if (!document.body) return

// Change --topbar-height css variable
document.documentElement.style.setProperty('--topbar-height', bp === 'xs' ? '3.875rem' : '3rem')

Expand Down
2 changes: 1 addition & 1 deletion packages/nc-gui/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const ncArrayFrom = <T>(
* ```
*/
export const isUnicodeEmoji = (emoji: string) => {
return !!emoji?.match(/(\p{Emoji}|\p{Extended_Pictographic})/gu)
return typeof emoji === 'string' && !!emoji.match(/(\p{Emoji}|\p{Extended_Pictographic})/gu)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/nc-gui/utils/dataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export const getLookupValue = (modelValue: string | null | number | Array<any>,

const colOptions = col.colOptions as LookupType
const relationColumnOptions = colOptions.fk_relation_column_id
? (meta?.value ?? meta)?.columns?.find((c) => c.id === colOptions.fk_relation_column_id)?.colOptions
? (meta?.value ?? meta)?.columns?.find((c) => c && c.id === colOptions.fk_relation_column_id)?.colOptions
: col.colOptions

// Use fk_related_base_id for cross-base relationships
Expand All @@ -471,7 +471,7 @@ export const getLookupValue = (modelValue: string | null | number | Array<any>,
const customDisplayColId = (relationColumnOptions as LinkToAnotherRecordType)?.fk_display_value_column_id
const childColumn = relatedTableMeta?.columns.find(
(c: ColumnType) =>
c.id === (colOptions?.fk_lookup_column_id ?? customDisplayColId ?? relatedTableMeta?.columns.find((c) => c.pv)?.id),
c && c.id === (colOptions?.fk_lookup_column_id ?? customDisplayColId ?? relatedTableMeta?.columns.find((c) => c?.pv)?.id),
) as ColumnType | undefined

// When the value is a record object (from Lookup of LTAR), extract the child column's
Expand Down
36 changes: 32 additions & 4 deletions packages/nocodb-sdk/src/lib/dashboard/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ interface PieChartAppearanceConfig {
showCountInLegend: boolean;
showPercentageOnChart: boolean;
legendPosition: 'top' | 'right' | 'bottom' | 'left' | 'none';
colorSchema: 'default' | 'custom';
colorSchema:
| 'default'
| 'classic'
| 'vibrant'
| 'pastel'
| 'earth'
| 'monoBlue'
| 'custom';
customColorSchema: {
color: string;
label: string;
Expand Down Expand Up @@ -90,7 +97,14 @@ export interface BarChartAppearanceConfig {
showCountInLegend: boolean;
showValueInChart: boolean;
legendPosition: 'top' | 'right' | 'bottom' | 'left' | 'none';
colorSchema: 'default' | 'custom';
colorSchema:
| 'default'
| 'classic'
| 'vibrant'
| 'pastel'
| 'earth'
| 'monoBlue'
| 'custom';
}

export interface BarChartConfig extends BaseChartConfig {
Expand All @@ -108,7 +122,14 @@ export interface LineChartAppearanceConfig {
showCountInLegend: boolean;
showValueInChart: boolean;
legendPosition: 'top' | 'right' | 'bottom' | 'left' | 'none';
colorSchema: 'default' | 'custom';
colorSchema:
| 'default'
| 'classic'
| 'vibrant'
| 'pastel'
| 'earth'
| 'monoBlue'
| 'custom';
}

export interface LineChartConfig extends BaseChartConfig {
Expand All @@ -124,7 +145,14 @@ export interface ScatterPlotAppearanceConfig {
showCountInLegend: boolean;
showValueInChart: boolean;
legendPosition: 'top' | 'right' | 'bottom' | 'left' | 'none';
colorSchema: 'default' | 'custom';
colorSchema:
| 'default'
| 'classic'
| 'vibrant'
| 'pastel'
| 'earth'
| 'monoBlue'
| 'custom';
}

export interface ScatterPlotConfig extends BaseChartConfig {
Expand Down
2 changes: 1 addition & 1 deletion packages/nocodb-sdk/src/lib/filter/filterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ export const getPlaceholderNewRow = (
['allof'].includes(eachFilter.comparison_op)
) {
const isMulti = parseProp(column.meta)?.is_multi;
if (isMulti || eachFilter.value?.indexOf?.(',') < 0) {
if (eachFilter.value && (isMulti || eachFilter.value.indexOf(',') < 0)) {
const assignedValue = eachFilter.value
.split(',')
.map((k) => (k === '@me' ? option?.currentUser?.id : k))
Expand Down
8 changes: 4 additions & 4 deletions packages/nocodb/src/schema/swagger-v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -14196,7 +14196,7 @@
"show_count_in_legend": { "type": "boolean" },
"show_percentage_on_chart": { "type": "boolean" },
"legend_position": { "type": "string", "enum": ["top", "right", "bottom", "left", "none"] },
"color_schema": { "type": "string", "enum": ["default", "custom"] },
"color_schema": { "type": "string", "enum": ["default", "classic", "vibrant", "pastel", "earth", "monoBlue", "custom"] },
"custom_color_schema": {
"type": "array",
"items": {
Expand Down Expand Up @@ -14250,7 +14250,7 @@
"show_count_in_legend": { "type": "boolean" },
"show_percentage_on_chart": { "type": "boolean" },
"legend_position": { "type": "string", "enum": ["top", "right", "bottom", "left", "none"] },
"color_schema": { "type": "string", "enum": ["default", "custom"] },
"color_schema": { "type": "string", "enum": ["default", "classic", "vibrant", "pastel", "earth", "monoBlue", "custom"] },
"custom_color_schema": {
"type": "array",
"items": {
Expand Down Expand Up @@ -14317,7 +14317,7 @@
"show_count_in_legend": { "type": "boolean" },
"show_value_in_chart": { "type": "boolean" },
"legend_position": { "type": "string", "enum": ["top", "right", "bottom", "left", "none"] },
"color_schema": { "type": "string", "enum": ["default", "custom"] }
"color_schema": { "type": "string", "enum": ["default", "classic", "vibrant", "pastel", "earth", "monoBlue", "custom"] }
}
}
},
Expand Down Expand Up @@ -14373,7 +14373,7 @@
"show_count_in_legend": { "type": "boolean" },
"show_value_in_chart": { "type": "boolean" },
"legend_position": { "type": "string", "enum": ["top", "right", "bottom", "left", "none"] },
"color_schema": { "type": "string", "enum": ["default", "custom"] }
"color_schema": { "type": "string", "enum": ["default", "classic", "vibrant", "pastel", "earth", "monoBlue", "custom"] }
}
}
},
Expand Down
Loading