Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Add property "description" to common options #211

Closed
wants to merge 10 commits into from
7 changes: 5 additions & 2 deletions dist/ngFormBuilder-complete.js
Expand Up @@ -89503,6 +89503,9 @@ module.exports = ['debounce', function(debounce) {
$scope.formComponents = _.cloneDeep(formioComponents.components);
_.each($scope.formComponents, function(component, key) {
component.settings.isNew = true;
if (!component.settings.hasOwnProperty('isConfigurable')) {
component.settings.isConfigurable = true;
}
if (component.settings.hasOwnProperty('builder') && !component.settings.builder || component.disabled) {
delete $scope.formComponents[key];
}
Expand Down Expand Up @@ -89765,7 +89768,7 @@ module.exports = [

$scope.addComponent = function(component, index) {
// Only edit immediately for components that are not resource comps.
if (component.isNew && !component.isNonEditable && (!component.key || (component.key.indexOf('.') === -1))) {
if (component.isNew && component.isConfigurable && (!component.key || (component.key.indexOf('.') === -1))) {
$scope.editComponent(component);
}
else {
Expand Down Expand Up @@ -90562,7 +90565,7 @@ app.run([
});

$templateCache.put('formio/formbuilder/editbuttons.html',
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton && component.isConfigurable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
);

$templateCache.put('formio/formbuilder/component.html',
Expand Down
4 changes: 2 additions & 2 deletions dist/ngFormBuilder-complete.min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/ngFormBuilder-full.js
Expand Up @@ -99331,6 +99331,9 @@ module.exports = ['debounce', function(debounce) {
$scope.formComponents = _.cloneDeep(formioComponents.components);
_.each($scope.formComponents, function(component, key) {
component.settings.isNew = true;
if (!component.settings.hasOwnProperty('isConfigurable')) {
component.settings.isConfigurable = true;
}
if (component.settings.hasOwnProperty('builder') && !component.settings.builder || component.disabled) {
delete $scope.formComponents[key];
}
Expand Down Expand Up @@ -99593,7 +99596,7 @@ module.exports = [

$scope.addComponent = function(component, index) {
// Only edit immediately for components that are not resource comps.
if (component.isNew && !component.isNonEditable && (!component.key || (component.key.indexOf('.') === -1))) {
if (component.isNew && component.isConfigurable && (!component.key || (component.key.indexOf('.') === -1))) {
$scope.editComponent(component);
}
else {
Expand Down Expand Up @@ -100390,7 +100393,7 @@ app.run([
});

$templateCache.put('formio/formbuilder/editbuttons.html',
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton && component.isConfigurable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
);

$templateCache.put('formio/formbuilder/component.html',
Expand Down
4 changes: 2 additions & 2 deletions dist/ngFormBuilder-full.min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/ngFormBuilder.js
Expand Up @@ -2925,6 +2925,9 @@ module.exports = ['debounce', function(debounce) {
$scope.formComponents = _.cloneDeep(formioComponents.components);
_.each($scope.formComponents, function(component, key) {
component.settings.isNew = true;
if (!component.settings.hasOwnProperty('isConfigurable')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I default the value to true, if it's not provided by the person registering the component.

component.settings.isConfigurable = true;
}
if (component.settings.hasOwnProperty('builder') && !component.settings.builder || component.disabled) {
delete $scope.formComponents[key];
}
Expand Down Expand Up @@ -3187,7 +3190,7 @@ module.exports = [

$scope.addComponent = function(component, index) {
// Only edit immediately for components that are not resource comps.
if (component.isNew && !component.isNonEditable && (!component.key || (component.key.indexOf('.') === -1))) {
if (component.isNew && component.isConfigurable && (!component.key || (component.key.indexOf('.') === -1))) {
$scope.editComponent(component);
}
else {
Expand Down Expand Up @@ -3973,7 +3976,7 @@ app.run([
});

$templateCache.put('formio/formbuilder/editbuttons.html',
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
"<div class=\"component-btn-group\">\n <div class=\"btn btn-xxs btn-danger component-settings-button\" style=\"z-index: 1000\" ng-click=\"removeComponent(component, formComponent.confirmRemove)\"><span class=\"glyphicon glyphicon-remove\"></span></div>\n <div ng-if=\"::!hideMoveButton && component.isConfigurable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\"><span class=\"glyphicon glyphicon glyphicon-move\"></span></div>\n <div ng-if=\"::formComponent.views && !component.isNonEditable\" class=\"btn btn-xxs btn-default component-settings-button\" style=\"z-index: 1000\" ng-click=\"editComponent(component)\"><span class=\"glyphicon glyphicon-cog\"></span></div>\n</div>\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Components with isConfigurable: false will not have an edit button.

);

$templateCache.put('formio/formbuilder/component.html',
Expand Down
4 changes: 2 additions & 2 deletions dist/ngFormBuilder.min.js

Large diffs are not rendered by default.