fixes to clique_types creations 83/39083/1
authorKoren Lev <korenlev@gmail.com>
Thu, 10 Aug 2017 16:52:10 +0000 (19:52 +0300)
committerKoren Lev <korenlev@gmail.com>
Thu, 10 Aug 2017 16:52:10 +0000 (19:52 +0300)
Change-Id: I05cf735bdb50bc5b0daa3f88cce0a017a96a7239
Signed-off-by: Koren Lev <korenlev@gmail.com>
ui/imports/api/clique-types/clique-types.js
ui/imports/ui/components/clique-type/clique-type.html
ui/imports/ui/components/clique-type/clique-type.js

index 852c319..e464b8f 100644 (file)
@@ -46,6 +46,7 @@ let schema = {
   link_types: {
     type: [String],
     minCount: 1,
+    defaultValue: [],
     custom: function () {
       let that = this;
       let findResult = R.all(function (pLinkType) {
index 318fb38..7130383 100644 (file)
@@ -61,7 +61,7 @@
 
         <div class="sm-field-group-link-types cl-field-group">
           <label class="cl-field-label">Link Types</label>
-          {{#if (getModelField 'link_types') }}
+          {{#if (exists (getModelField 'link_types')) }}
           {{>SelectableOrderedInput (argsLinkTypesInput linkTypesList (getModelField 'link_types')) }}
           {{/if }}
           <div class="cl-field-desc">Link Types</div>
index 31efc88..ae50b94 100644 (file)
@@ -213,6 +213,10 @@ Template.CliqueType.helpers({
       },
     };
   },
+
+  exists: function (val) {
+    return ! R.isNil(val);
+  }
 }); // end: helpers
 
 function initInsertView(instance, query) {