From ee336f9b307e8d53f4c7781539e74ea226b4a7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 26 Nov 2018 13:46:45 +0100 Subject: [PATCH] workflows: allow specifying body data for PATCH & PUT webservice calls (#28345) --- wcs/qommon/templates/qommon/forms/widget.html | 3 +++ wcs/wf/wscall.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wcs/qommon/templates/qommon/forms/widget.html b/wcs/qommon/templates/qommon/forms/widget.html index 35e1ea975..97fb36b57 100644 --- a/wcs/qommon/templates/qommon/forms/widget.html +++ b/wcs/qommon/templates/qommon/forms/widget.html @@ -16,6 +16,9 @@ {% if "data-dynamic-display-value" in widget.attrs %} data-dynamic-display-value="{{widget.attrs|get:"data-dynamic-display-value"}}" {% endif %} + {% if "data-dynamic-display-value-in" in widget.attrs %} + data-dynamic-display-value-in="{{widget.attrs|get:"data-dynamic-display-value-in"}}" + {% endif %} {% if widget.live_condition_source %}data-live-source="true"{% endif %} > {% block widget-title %} diff --git a/wcs/wf/wscall.py b/wcs/wf/wscall.py index d8336a225..f36527a6c 100644 --- a/wcs/wf/wscall.py +++ b/wcs/wf/wscall.py @@ -193,7 +193,10 @@ class WebserviceCallStatusItem(WorkflowStatusItem): value=self.post, attrs={ 'data-dynamic-display-child-of': '%smethod' % prefix, - 'data-dynamic-display-value': methods.get('POST'), + 'data-dynamic-display-value-in': '|'.join( + [_(methods['POST']), + _(methods['PUT']), + _(methods['PATCH'])]) }) if 'post_data' in parameters: form.add(WidgetDict, '%spost_data' % prefix, @@ -202,7 +205,10 @@ class WebserviceCallStatusItem(WorkflowStatusItem): element_value_type=ComputedExpressionWidget, attrs={ 'data-dynamic-display-child-of': '%smethod' % prefix, - 'data-dynamic-display-value': methods.get('POST'), + 'data-dynamic-display-value-in': '|'.join( + [_(methods['POST']), + _(methods['PUT']), + _(methods['PATCH'])]) }) response_types = collections.OrderedDict( -- 2.20.0.rc1