Skip to content

Commit

Permalink
Allow user to specify default value
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Nov 6, 2024
1 parent 946d014 commit 07cedd0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arches_references/media/js/viewmodels/reference-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([
var ReferenceSelectViewModel = function(params) {
var self = this;

params.configKeys = ['placeholder'];
params.configKeys = ['placeholder', 'defaultValue'];
this.multiple = !!ko.unwrap(params.node.config.multiValue);
this.displayName = ko.observable('');
this.selectionValue = ko.observable([]); // formatted version of this.value that select2 can use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
>
</div>
</div>
<div class="control-label">
<span data-bind="text: $root.translations.defaultValue"></span>
</div>
<div class="col-xs-12 resource-instance-wrapper" data-bind="class: nodeCssClasses">
<select style="display:inline-block;"
data-bind="
select2Query: {
select2Config: select2Config
},
attr: {'data-label': label, 'aria-label': label}
">
</div>
{% endblock config_form %}

{% block report %}
Expand Down

0 comments on commit 07cedd0

Please sign in to comment.