Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions adminforth/spa/src/components/GroupsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@
arrayItemRefs.value[arrayItemRefs.value.length - 1].focus();
}

watch(customComponentsInValidity, (newVal) => {
watch(customComponentsInValidity.value, (newVal) => {
emit('update:customComponentsInValidity', newVal);
});

watch(customComponentsEmptiness, (newVal) => {
watch(customComponentsEmptiness.value, (newVal) => {
emit('update:customComponentsEmptiness', newVal);
});

Expand Down
9 changes: 5 additions & 4 deletions adminforth/spa/src/components/ResourceForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ const columnError = (column) => {
if (!currentValues.value) {
return null;
}
if (customComponentsInValidity.value[column.name]) {
return customComponentsInValidity.value[column.name];
if (customComponentsInValidity.value?.value?.[column.name]) {
return customComponentsInValidity.value?.value?.[column.name];
}

if (
column.required[mode.value] &&
(currentValues.value[column.name] === undefined || currentValues.value[column.name] === null || currentValues.value[column.name] === '' || (column.isArray?.enabled && !currentValues.value[column.name].length)) &&
// if component is custum it might tell other criteria for emptiness by emitting 'update:emptiness'
// components which do not emit 'update:emptiness' will have undefined value in customComponentsEmptiness
(customComponentsEmptiness.value[column.name] !== false)
(customComponentsEmptiness.value?.value?.[column.name] !== false)

) {
return t('This field is required');
Expand All @@ -130,6 +130,7 @@ const columnError = (column) => {
return validateValue(column.type, currentValues.value[column.name], column);
}

return null;
});
return val.value;
};
Expand Down