Skip to content
Snippets Groups Projects
Verified Commit 041f4e79 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

lso result step title is now always the name of the provisioning step

the optional label remains, if found to be useful at a later point in time
parent beed6610
No related branches found
No related tags found
1 merge request!175lso result step title is now always the name of the provisioning step
Pipeline #85961 passed
......@@ -124,14 +124,9 @@ def _show_results(state: State) -> FormGenerator:
if "callback_result" not in state:
return state
if "lso_result_title" in state:
result_title = state["lso_result_title"]
else:
result_title = f"Execution for {state['subscription']['product']['name']} completed."
class ConfirmRunPage(FormPage):
class Config:
title: str = result_title
title: str = state["lso_result_title"]
if "lso_result_extra_label" in state:
extra_label: Label = state["lso_result_extra_label"]
......@@ -139,7 +134,7 @@ def _show_results(state: State) -> FormGenerator:
run_results: LongText = ReadOnlyField(json.dumps(state["callback_result"], indent=4))
yield ConfirmRunPage
[state.pop(key) for key in ["run_results", "lso_result_title", "lso_result_extra_label"]]
[state.pop(key, None) for key in ["run_results", "lso_result_title", "lso_result_extra_label"]]
return state
......@@ -161,11 +156,8 @@ def lso_interaction(provisioning_step: Step) -> StepList:
"""
return (
begin
>> callback_step(
name=provisioning_step.name,
action_step=provisioning_step,
validate_step=_evaluate_results,
)
>> callback_step(name=provisioning_step.name, action_step=provisioning_step, validate_step=_evaluate_results)
>> step("Inject result title")(lambda: {"lso_result_title": provisioning_step.name})
>> _show_results
)
......@@ -188,10 +180,7 @@ def indifferent_lso_interaction(provisioning_step: Step) -> StepList:
"""
return (
begin
>> callback_step(
name=provisioning_step.name,
action_step=provisioning_step,
validate_step=_ignore_results,
)
>> callback_step(name=provisioning_step.name, action_step=provisioning_step, validate_step=_ignore_results)
>> step("Inject result title")(lambda: {"lso_result_title": provisioning_step.name})
>> _show_results
)
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