Skip to content

Commit

Permalink
💡 [#4908] Update TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorvanwijk committed Dec 19, 2024
1 parent 7cb5a02 commit 3126061
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import FormRow from 'components/admin/forms/FormRow';
import ReactSelect from 'components/admin/forms/ReactSelect';

// TODO-4908: where to add already selected form variables from the variables table?
// TODO-4098: the select box does not change size when you add more form variables, which causes
// selected form variables to be hidden
const FormVariablesSelect = ({options}) => {
const [fieldProps, , fieldHelpers] = useField('formVariables');
const {setValue} = fieldHelpers;
Expand Down
12 changes: 8 additions & 4 deletions src/openforms/registrations/contrib/json/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def register_submission(self, submission: Submission, options: OptionsT) -> None
f.seek(0)
values[attachment.form_key] = base64.b64encode(f.read()).decode()

# TODO-4908: what should the behaviour be when a form
# variable is not in the data or static variables?
# Create static variables dict
static_variables = get_static_variables(submission=submission)
static_variables_dict = {
variable.key: variable.initial_value for variable in static_variables
}

# TODO-4908: what should the behaviour be when a form
# variable is not in the data or static variables?
# Update values dict with relevant form data
values.update({
form_variable: submission.data.get(
Expand All @@ -54,12 +54,15 @@ def register_submission(self, submission: Submission, options: OptionsT) -> None
# Send to the service
json = {"values": values}
service = options["service"]
# TODO-4098: is the service type relevant here?
with build_client(service) as client:
url = f"{client.base_url}{options['relative_api_endpoint']}"
response = client.post(url, json=json, headers={"Content-Type": "application/json"})
response.raise_for_status()
print(response.json())

# TODO-4908: does this need to be used? If so, what to put in spec?
# TODO-4908: does this need to be used (what does it even do, there is no documentation)?
# If so, what to put in spec?
# result = execute_unless_result_exists(
# partial(
# client.post,
Expand All @@ -73,6 +76,7 @@ def register_submission(self, submission: Submission, options: OptionsT) -> None
# TODO-4908: added return for testing purposes
return json

# TODO-4098: what to do in here?
def check_config(self):
# TODO-4098: check if it's possible to connect to the service
# TODO-4098: check anything else?
pass

0 comments on commit 3126061

Please sign in to comment.