This commit is contained in:
2022-01-31 12:43:34 +01:00
parent 0375385b35
commit 5ac979fa4a
6 changed files with 48 additions and 38 deletions
+42 -8
View File
@@ -17,7 +17,7 @@
//import FormErrorView from './form-error-view.vue';
import * as overlays from '../services/overlay';
import * as notifications from '../services/notification';
import { arrayGroupBy } from '../utils/arrays';
import { arrayGroupBy, selectorToArray } from '../utils';
export default defineComponent({
name: 'uiForm',
@@ -276,21 +276,55 @@
let errorGroups = arrayGroupBy(this.errors, 'property');
let handledGroups = [];
console.info({ errorComponents, errorGroups });
// set errors
errorComponents.forEach(component =>
{
let field = component.field;
if (field && errorGroups[field])
if (field)
{
handledGroups.push(field);
component.setErrors(errorGroups[field]);
if (component.tab)
this.errors.forEach(error =>
{
component.tab.setErrors(true);
}
let errorField = error.property;
let errorFieldSelector = selectorToArray(errorField);
// exact error field match
if (errorField == field)
{
handledGroups.push(field);
component.setErrors(error, true);
if (component.tab)
{
component.tab.setErrors(true);
}
}
// nested error
else if (errorFieldSelector[0] == field)
{
handledGroups.push(field);
component.setErrors(error, true);
if (component.tab)
{
component.tab.setErrors(true);
}
}
});
}
//if (field && errorGroups[field])
//{
// handledGroups.push(field);
// component.setErrors(errorGroups[field]);
// if (component.tab)
// {
// component.tab.setErrors(true);
// }
//}
});
for (var field in errorGroups)
@@ -112,7 +112,11 @@
top: 0;
z-index: 2;
background: var(--color-bg);
background: linear-gradient(0deg, transparent, var(--color-bg) 40%);
//width: auto;
//border-radius: var(--radius);
//box-shadow: 0 0 10px rgba(0,0,0,0.1);
//margin-bottom: var(--padding);
//background: linear-gradient(0deg, transparent, var(--color-bg) 30%);
}
}
@@ -3,7 +3,7 @@
<ui-trinity class="ui-module-overlay">
<template v-slot:header>
<ui-header-bar title="@listfilter.headline" :back-button="false" :close-button="true" />
<ui-header-bar title="@listfilter.headline" :back-button="false" :close-button="true" @close="config.close(true)" />
</template>
<template v-slot:footer>
@@ -29,7 +29,6 @@
</span>
</button>
<div v-for="column in columns" :key="column.path" class="ui-table-cell" :class="column.class" :style="column.flex"
:contenteditable="true"
@input="onFieldValueChange(column, $event)"
:table-field="column.path" :field-type="column.type" v-table-value="{ column, item }"></div>
<div v-if="listConfig.hasOptions" table-field="table_options" class="ui-table-cell is-options">
-26
View File
@@ -1,26 +0,0 @@
using Raven.Client.Documents.Indexes;
namespace zero.Media;
public class Media_ByParent : ZeroMultiMapIndex<MediaListItem>
{
protected override void Create()
{
AddMap<Media>(items => items.Select(item => new MediaListItem
{
Id = item.Id,
ParentId = item.ParentId,
CreatedDate = item.CreatedDate,
IsFolder = false,
Name = item.Name,
Image = item.ImageMeta != null ? item.ImageMeta.Thumbnails["thumb"] : null,
Children = 0,
Size = item.Size,
IsShared = item.Blueprint != null,
AspectRatio = item.ImageMeta != null ? (float)item.ImageMeta.Width / item.ImageMeta.Height : 0
}));
StoreAllFields(FieldStorage.Yes);
Index(x => x.ParentId, FieldIndexing.Exact);
}
}
-1
View File
@@ -39,7 +39,6 @@ internal class ZeroMediaModule : ZeroModule
{
RavenOptions raven = opts.For<RavenOptions>();
raven.Indexes.Add<Media_ByChildren>();
raven.Indexes.Add<Media_ByParent>();
raven.Indexes.Add<Media_ByHierarchy>();
});