some editor fixes

This commit is contained in:
2020-06-29 14:23:05 +02:00
parent 31013d0b81
commit 3956ae689f
5 changed files with 23 additions and 11 deletions
+5
View File
@@ -20,6 +20,11 @@ namespace zero.Core.Api
return true;
}
if (appId.IsNullOrWhiteSpace())
{
return false;
}
if (IncludeShared && appId.Equals(Constants.Database.SharedAppId, StringComparison.OrdinalIgnoreCase))
{
return true;
+6 -5
View File
@@ -115,6 +115,12 @@ namespace zero.Core.Api
}
}
// set app id
if (appAwareEntity != null && appAwareEntity.AppId.IsNullOrEmpty())
{
appAwareEntity.AppId = Scope.AppId; // Constants.Database.SharedAppId; // TODO correct app id
}
// check if current app id is valid
if (!model.Id.IsNullOrEmpty() && Scope.IsAppAware && appAwareEntity != null)
{
@@ -170,11 +176,6 @@ namespace zero.Core.Api
zeroEntity.CreatedDate = DateTimeOffset.Now;
}
if (appAwareEntity != null && appAwareEntity.AppId.IsNullOrEmpty())
{
appAwareEntity.AppId = Scope.AppId; // Constants.Database.SharedAppId; // TODO correct app id
}
if (model is ILanguageAwareEntity)
{
(model as ILanguageAwareEntity).LanguageId = "languages.1-A"; // TODO correct language id
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<ui-property v-if="fulfillsCondition" :field="config.field" :label="label" :description="description" :required="config.required" :class="classList" :is-text="view === 'output'">
<component v-if="fieldComponent" :is="fieldComponent" :config="config" :value="model" @input="onChange" />
<component v-if="fieldComponent" :is="fieldComponent" :config="config" :value="model" @input="onChange" :disabled="config.disabled" />
<p v-if="config.helpText" class="ui-property-help" v-localize="config.helpText"></p>
</ui-property>
</template>
+4 -3
View File
@@ -1,6 +1,6 @@
<template>
<div class="editor-outer -infos-aside" v-if="loaded" :class="{ 'has-tabs': hasTabs }">
<ui-tabs class="editor" :active="2">
<ui-tabs class="editor">
<ui-tab class="ui-box" :label="tab.label" :count="tab.count(value)" v-for="(tab, index) in tabs" :key="index">
<editor-component v-for="(field, fieldIndex) in tab.fields" :key="fieldIndex" :config="field" :renderer="configuration" v-model="value" />
</ui-tab>
@@ -8,7 +8,7 @@
<aside v-if="infos && infos != 'none'" class="editor-infos">
<div class="ui-box editor-active-toggle" :class="{'is-active': value.isActive }">
<div class="ui-box editor-active-toggle" v-if="isShared || activeToggle" :class="{'is-active': value.isActive }">
<slot name="settings">
<div v-if="isShared" class="editor-global-flag">
<b>This entity is shared</b> and can be used by all applications.<br>
@@ -18,6 +18,7 @@
<ui-property v-if="activeToggle" label="@ui.active" :is-text="true" class="is-toggle">
<ui-toggle v-model="value.isActive" class="is-primary" />
</ui-property>
<slot name="settings-after"></slot>
</slot>
</div>
<div class="ui-box is-light is-connected">
@@ -136,7 +137,7 @@
this.hasTabs = this.tabs.length > 0;
if (!this.tabs.length)
if (this.tabs.length < 1)
{
this.tabs.push({
label: '',
+7 -2
View File
@@ -1,5 +1,5 @@
<template>
<ui-toggle :value="value" @input="$emit('input', $event)" />
<ui-toggle :value="value" @input="$emit('input', $event)" :disabled="disabled" />
</template>
@@ -9,7 +9,12 @@
value: {
type: Boolean,
default: false
}
},
disabled: {
type: Boolean,
default: false
},
config: Object
}
}
</script>