validation issue half working, fixing some bugs with context menu

This commit is contained in:
Gerard Burns 2024-04-16 10:27:52 +01:00
parent 56f7dd33c7
commit 4b52508625
6 changed files with 20 additions and 10 deletions

View File

@ -36,6 +36,6 @@
<style>
.explanationModalContent {
max-width: 300px;
padding: 16px 12px 0px;
padding: 16px 12px 2px;
}
</style>

View File

@ -25,7 +25,7 @@
<Subject heading="Dates as Numbers">
<Section>
A date can be used in place of a numeric value, but it will be parsed as a UNIX epoch timestamp, which is the number of milliseconds since Jan 1st 1970. A more recent Date/Time will be a higher number.
A date can be used in place of a numeric value, but it will be parsed as a <Block>UNIX epoch</Block> timestamp, which is the number of milliseconds since Jan 1st 1970. A more recent moment in time will be a higher number.
</Section>
<Section>

View File

@ -5284,7 +5284,7 @@
{
"type": "field",
"label": "Data column",
"key": "valueColumns",
"key": "valueColumn",
"dependsOn": "dataSource",
"required": true
}
@ -5309,7 +5309,7 @@
{
"type": "field",
"label": "Data column",
"key": "valueColumns",
"key": "valueColumn",
"dependsOn": "dataSource",
"required": true
}
@ -5381,7 +5381,7 @@
{
"type": "field",
"label": "Value column",
"key": "valueColumns",
"key": "valueColumn",
"dependsOn": "dataSource",
"required": true
},
@ -5533,7 +5533,8 @@
"type": "field",
"label": "Date column",
"key": "dateColumn",
"dependsOn": "dataSource"
"dependsOn": "dataSource",
"required": true
},
{
"type": "field",

View File

@ -273,8 +273,9 @@
staticSettings = instanceSettings.staticSettings
dynamicSettings = instanceSettings.dynamicSettings
console.log(settingsDefinition, settingsDefinitionMap);
// Check if we have any missing required settings
missingRequiredSettings = settingsDefinition.filter(setting => {
missingRequiredSettings = Object.values(settingsDefinitionMap).filter(setting => {
let empty = instance[setting.key] == null || instance[setting.key] === ""
let missing = setting.required && empty
@ -283,13 +284,21 @@
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
const dependsOnValue = setting.dependsOn.value
const realDependentValue = instance[dependsOnKey]
let foo = false && instance._component === "@budibase/standard-components/chartblock" && setting.type === "multifield"
if (foo) {
console.log(setting)
console.log(instance);
}
if (dependsOnValue === undefined && realDependentValue) {
if (foo) console.log("in 0");
return missing
}
if (dependsOnValue == null && realDependentValue == null) {
if (foo) console.log("in 1");
return false
}
if (dependsOnValue !== realDependentValue) {
if (foo) console.log("in 2");
return false
}
}

View File

@ -24,7 +24,7 @@
export let width
// Pie/Donut
// export let valueColumn
export let valueColumn
// Bar
export let stacked
@ -78,7 +78,7 @@
width,
title: chartTitle,
labelColumn,
valueColumn: valueColumns,
valueColumn,
valueColumns,
palette,
dataLabels,

View File

@ -111,7 +111,7 @@
if (!useDates) {
const value = get(row, column);
if (schema[column].type === 'datetime') {
if (schema?.[column]?.type === 'datetime') {
return Date.parse(value)
}