json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Array / ui-sortable missing sortOptions #812

Open coxrichuk opened 7 years ago

coxrichuk commented 7 years ago

I am passing sortOptions to set some options for ui-sortable, however nothing is being returned.

When I look at the bootstrap decorator I can see the variable is being pulled out

https://github.com/json-schema-form/angular-schema-form-bootstrap/blob/develop/src/array.html#L5

However inside the template cache:

bower_components/angular-schema-form/dist/bootstrap-decorator.js

I can see the the variable is not being pulled out against ui-sortable:

$templateCache.put(
  "directives/decorators/bootstrap/array.html",
  "<div sf-array=\"form\" class=\"schema-form-array {{form.htmlClass}}\" ng-model=\"$$value$$\" ng-model-options=\"form.ngModelOptions\"><label class=\"control-label\" ng-show=\"showTitle()\">{{ form.title }}</label><ol class=\"list-group\" ng-model=\"modelArray\" ui-sortable=\"\"><li class=\"list-group-item {{form.fieldHtmlClass}}\" ng-repeat=\"item in modelArray track by $index\"><button ng-hide=\"form.readonly || form.remove === null\" ng-click=\"deleteFromArray($index)\" style=\"position: relative; z-index: 20;\" type=\"button\" class=\"close pull-right\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button><sf-decorator ng-init=\"arrayIndex = $index\" form=\"copyWithIndex($index)\"></sf-decorator></li></ol><div class=\"clearfix\" style=\"padding: 15px;\"><button ng-hide=\"form.readonly || form.add === null\" ng-click=\"appendToArray()\" type=\"button\" class=\"btn {{ form.style.add || \'btn-default\' }} pull-right\"><i class=\"glyphicon glyphicon-plus\"></i> {{ form.add || \'Add\'}}</button></div><div class=\"help-block\" ng-show=\"(hasError() && errorMessage(schemaError())) || form.description\" ng-bind-html=\"(hasError() && errorMessage(schemaError())) || form.description\"></div></div>"
);

After a bit more digging I have found that the bower.json is not pulling through the latest bootstrap decorator.

Could this be updated please?

@json-schema-form/angular-schema-form-lead

Anthropic commented 7 years ago

@coxrichuk can you try the version in support/0.x branch and let me know if that fixes it and if so I will push it out.