validation issue half working, fixing some bugs with context menu
This commit is contained in:
parent
56f7dd33c7
commit
4b52508625
|
@ -36,6 +36,6 @@
|
||||||
<style>
|
<style>
|
||||||
.explanationModalContent {
|
.explanationModalContent {
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
padding: 16px 12px 0px;
|
padding: 16px 12px 2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
<Subject heading="Dates as Numbers">
|
<Subject heading="Dates as Numbers">
|
||||||
<Section>
|
<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>
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
|
|
|
@ -5284,7 +5284,7 @@
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
"label": "Data column",
|
"label": "Data column",
|
||||||
"key": "valueColumns",
|
"key": "valueColumn",
|
||||||
"dependsOn": "dataSource",
|
"dependsOn": "dataSource",
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
|
@ -5309,7 +5309,7 @@
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
"label": "Data column",
|
"label": "Data column",
|
||||||
"key": "valueColumns",
|
"key": "valueColumn",
|
||||||
"dependsOn": "dataSource",
|
"dependsOn": "dataSource",
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
|
@ -5381,7 +5381,7 @@
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
"label": "Value column",
|
"label": "Value column",
|
||||||
"key": "valueColumns",
|
"key": "valueColumn",
|
||||||
"dependsOn": "dataSource",
|
"dependsOn": "dataSource",
|
||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
|
@ -5533,7 +5533,8 @@
|
||||||
"type": "field",
|
"type": "field",
|
||||||
"label": "Date column",
|
"label": "Date column",
|
||||||
"key": "dateColumn",
|
"key": "dateColumn",
|
||||||
"dependsOn": "dataSource"
|
"dependsOn": "dataSource",
|
||||||
|
"required": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
|
|
|
@ -273,8 +273,9 @@
|
||||||
staticSettings = instanceSettings.staticSettings
|
staticSettings = instanceSettings.staticSettings
|
||||||
dynamicSettings = instanceSettings.dynamicSettings
|
dynamicSettings = instanceSettings.dynamicSettings
|
||||||
|
|
||||||
|
console.log(settingsDefinition, settingsDefinitionMap);
|
||||||
// Check if we have any missing required settings
|
// 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 empty = instance[setting.key] == null || instance[setting.key] === ""
|
||||||
let missing = setting.required && empty
|
let missing = setting.required && empty
|
||||||
|
|
||||||
|
@ -283,13 +284,21 @@
|
||||||
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
|
const dependsOnKey = setting.dependsOn.setting || setting.dependsOn
|
||||||
const dependsOnValue = setting.dependsOn.value
|
const dependsOnValue = setting.dependsOn.value
|
||||||
const realDependentValue = instance[dependsOnKey]
|
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 (dependsOnValue === undefined && realDependentValue) {
|
||||||
|
if (foo) console.log("in 0");
|
||||||
return missing
|
return missing
|
||||||
}
|
}
|
||||||
if (dependsOnValue == null && realDependentValue == null) {
|
if (dependsOnValue == null && realDependentValue == null) {
|
||||||
|
if (foo) console.log("in 1");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (dependsOnValue !== realDependentValue) {
|
if (dependsOnValue !== realDependentValue) {
|
||||||
|
if (foo) console.log("in 2");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
export let width
|
export let width
|
||||||
|
|
||||||
// Pie/Donut
|
// Pie/Donut
|
||||||
// export let valueColumn
|
export let valueColumn
|
||||||
|
|
||||||
// Bar
|
// Bar
|
||||||
export let stacked
|
export let stacked
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
width,
|
width,
|
||||||
title: chartTitle,
|
title: chartTitle,
|
||||||
labelColumn,
|
labelColumn,
|
||||||
valueColumn: valueColumns,
|
valueColumn,
|
||||||
valueColumns,
|
valueColumns,
|
||||||
palette,
|
palette,
|
||||||
dataLabels,
|
dataLabels,
|
||||||
|
|
|
@ -111,7 +111,7 @@
|
||||||
if (!useDates) {
|
if (!useDates) {
|
||||||
const value = get(row, column);
|
const value = get(row, column);
|
||||||
|
|
||||||
if (schema[column].type === 'datetime') {
|
if (schema?.[column]?.type === 'datetime') {
|
||||||
return Date.parse(value)
|
return Date.parse(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue