Skip to content
Snippets Groups Projects
Unverified Commit 4d06f5de authored by Pierre-André Boissinot's avatar Pierre-André Boissinot Committed by GitHub
Browse files

adjust sso mapping fields to prevent select disabled (#2474)

* adjust sso mapping fields to prevent select disabled

* remove unused param

* also undisable when mounting app

* double negation
parent 811b9562
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ end
</div>
</draggable>
<a v-on:click="fields.push({sso_key: 'key', internal_key: 'email', roles: {}})" class="btn btn-primary btn-sm">
<a v-on:click="addField" class="btn btn-primary btn-sm">
<%= t('add_field') %>
</a>
</div>
......@@ -84,6 +84,27 @@ end
fields: <%= object.sso_mapping.blank? ? '[]' : object.sso_mapping.to_json.html_safe %>,
keys: <%= mapping_keys.map { |key| [key, User.human_attribute_name(key)] }.to_h.to_json.html_safe %>
}
},
methods: {
addField: function () {
this.fields.push({sso_key: 'key', internal_key: 'email', roles: {}});
this.enableSelects();
},
enableSelects: function () {
// conditional.js messes with the new field added, so we have to force enable the select fields
var selectFields,
i;
setTimeout(function() {
selectFields = document.getElementById("app").getElementsByClassName("form-select");
for (i = 0; i < selectFields.length; i += 1) {
target = selectFields[i];
target.removeAttribute('disabled');
}
}, 100);
}
},
mounted() {
this.enableSelects();
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment