Skip to content

Commit 31ecad5

Browse files
committed
Merge branch 'feature/descriptions-in-fieldsets' of https://github.com/mike-marcacci/angular-schema-form into mike-marcacci-feature/descriptions-in-fieldsets
Conflicts: dist/bootstrap-decorator.min.js dist/schema-form.min.js
2 parents 33fbd2a + 0f52e6d commit 31ecad5

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

dist/bootstrap-decorator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema-form.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,18 @@ angular.module('schemaForm').provider('schemaForm',
456456

457457
// Takes a titleMap in either object or list format and returns one in
458458
// in the list format.
459-
var canonicalTitleMap = function(titleMap) {
459+
var canonicalTitleMap = function(titleMap, originalEnum) {
460460
if (!angular.isArray(titleMap)) {
461461
var canonical = [];
462-
angular.forEach(titleMap, function(name, value) {
463-
canonical.push({name: name, value: value});
464-
});
462+
if (originalEnum) {
463+
angular.forEach(originalEnum, function(value, index) {
464+
canonical.push({name: titleMap[value], value: value});
465+
});
466+
} else {
467+
angular.forEach(titleMap, function(name, value) {
468+
canonical.push({name: name, value: value});
469+
});
470+
}
465471
return canonical;
466472
}
467473
return titleMap;
@@ -502,7 +508,7 @@ angular.module('schemaForm').provider('schemaForm',
502508

503509
//Non standard attributes
504510
if (schema.validationMessage) { f.validationMessage = schema.validationMessage; }
505-
if (schema.enumNames) { f.titleMap = canonicalTitleMap(schema.enumNames); }
511+
if (schema.enumNames) { f.titleMap = canonicalTitleMap(schema.enumNames, schema.enum); }
506512
f.schema = schema;
507513

508514
// Ng model options doesn't play nice with undefined, might be defined

dist/schema-form.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<fieldset ng-disabled="form.readonly">
22
<legend ng-show="form.title">{{ form.title }}</legend>
3+
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
34
<div ng-transclude></div>
45
</fieldset>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<fieldset ng-disabled="form.readonly">
22
<legend ng-show="form.title">{{ form.title }}</legend>
3+
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
34
<sf-decorator ng-repeat="item in form.items" form="item"></sf-decorator>
45
</fieldset>

0 commit comments

Comments
 (0)