From 8b0e2ed991e9a1a49ef92e314d3d4855beb93b46 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 12 Sep 2014 18:27:20 +0200 Subject: [PATCH] webui: allow to skip link widget link validation Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/widget.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 10715aa49..f44710384 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -4096,8 +4096,21 @@ IPA.link_widget = function(spec) { */ that.other_pkeys = spec.other_pkeys || other_pkeys; + /** + * Indicates if it's a valid link + * @property {boolean} + */ that.is_link = spec.is_link || false; + /** + * Whether to skip entity validation step + * + * Value of `is_link` won't be changed. + * + * @property {boolean} + */ + that.no_check = spec.no_check; + that.value = ''; that.values = []; @@ -4131,7 +4144,7 @@ IPA.link_widget = function(spec) { that.value = that.values.slice(-1)[0] || ''; that.link.html(that.value); that.nonlink.html(that.value); - + that.update_link(); that.check_entity_link(); that.on_value_changed(values); }; @@ -4177,6 +4190,8 @@ IPA.link_widget = function(spec) { return; } + if (that.no_check) return; + rpc.command({ entity: that.other_entity.name, method: 'show', @@ -4192,8 +4207,6 @@ IPA.link_widget = function(spec) { that.update_link(); } }).execute(); - - that.update_link(); }; /** @inheritDoc */