From d40ce96a3f61351f0e23c80ce6efc128a654857f Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Tue, 29 Sep 2020 14:15:22 +0200 Subject: [PATCH] mini mini updates --- zero.Debug/Controllers/TestController.cs | 4 +-- zero.Web.UI/App/editor/fields/amount.vue | 29 +++++++++++++++++++ zero.Web.UI/App/editor/fields/nested.vue | 10 +++++-- .../Resources/Localization/zero.en-us.json | 2 ++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 zero.Web.UI/App/editor/fields/amount.vue diff --git a/zero.Debug/Controllers/TestController.cs b/zero.Debug/Controllers/TestController.cs index 05fad968..67eeaa20 100644 --- a/zero.Debug/Controllers/TestController.cs +++ b/zero.Debug/Controllers/TestController.cs @@ -210,9 +210,9 @@ namespace zero.Debug.Controllers Name = "Österreichische Post", ShippingOptionId = "shippingOptions.1-A", Price = 7.99m, - Lines = new Dictionary() + Lines = new List() { - { "Postfach", "7-A" } + new OrderShippingLine() { Key = "Postfach", Value = "7-A" } }, Address = shippingAddress, Deliveries = new List() diff --git a/zero.Web.UI/App/editor/fields/amount.vue b/zero.Web.UI/App/editor/fields/amount.vue new file mode 100644 index 00000000..4de742da --- /dev/null +++ b/zero.Web.UI/App/editor/fields/amount.vue @@ -0,0 +1,29 @@ + + + + \ No newline at end of file diff --git a/zero.Web.UI/App/editor/fields/nested.vue b/zero.Web.UI/App/editor/fields/nested.vue index 0f2d63c2..02996348 100644 --- a/zero.Web.UI/App/editor/fields/nested.vue +++ b/zero.Web.UI/App/editor/fields/nested.vue @@ -41,7 +41,8 @@ data: () => ({ items: [], - limit: 100 + limit: 100, + multiple: false }), @@ -49,6 +50,11 @@ { this.items = JSON.parse(JSON.stringify(this.value)); this.limit = this.config.limit || this.limit; + this.multiple = this.limit > 1; + if (!this.multiple) + { + this.items = this.items ? [this.items] : []; + } }, @@ -107,7 +113,7 @@ onChange() { - this.$emit('input', this.items); + this.$emit('input', this.multiple ? this.items : (this.items.length > 0 ? this.items[0] : null)); }, diff --git a/zero.Web/Resources/Localization/zero.en-us.json b/zero.Web/Resources/Localization/zero.en-us.json index 48a575fe..282cefbc 100644 --- a/zero.Web/Resources/Localization/zero.en-us.json +++ b/zero.Web/Resources/Localization/zero.en-us.json @@ -4,6 +4,8 @@ }, "ui": { + "yes": "Yes", + "no": "No", "more": "More", "add": "Add", "actions": "Actions",