From 0871032a9d79ecad92bcfec3c555a2a74f91cc5d Mon Sep 17 00:00:00 2001 From: Shweelan Samson Date: Wed, 12 Sep 2018 02:28:39 +0300 Subject: [PATCH] Make presets provision input as combo --- client/presets-page.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/presets-page.js b/client/presets-page.js index ab4159b..1cb2644 100644 --- a/client/presets-page.js +++ b/client/presets-page.js @@ -22,7 +22,7 @@ const attributes = [ { id: "schedule", label: "Schedule" }, { id: "events", label: "Events" }, { id: "precondition", label: "Precondition" }, - { id: "provision", label: "Provision" }, + { id: "provision", label: "Provision", type: "combo" }, { id: "provisionArgs", label: "Arguments" } ]; @@ -322,6 +322,16 @@ const component = { }); let count = store.count("presets", filter); + const provisions = store.fetch("provisions", true); + if (provisions.fulfilled) { + let provisionAttr = attributes.find(attr => { + return attr.id === "provision"; + }); + provisionAttr.options = provisions.value.map(v => { + return v["_id"]; + }); + } + let selected = new Set(); if (vnode.state.selected) for (let preset of presets.value)