fix messaging 'test connection' workflow on initial save #2751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Helps close #2455
specifically meant to resolve issue reported in this comment
Code Changes
messagingDetails
param was undefined in the case where the messaging config form loads from "scratch", i.e. there is no messaging default already present for the given service type. this is because thegetMessagingConfigurationDetails()
query against the backend gets an (expected)404
in these casesTestMessagingProviderConnectionButton
constructor only really requires theservice_type
from themessagingDetails
, and we know theservice_type
already given the context of the form, i just define a dummymessagingDetails
object with theservice_type
inferred from the context of the form, in the cases where we haven't successfully retrieved themessagingDetails
from the APISteps to Confirm
Without fix:
nox -s teardown -- volumes
)nox -s dev -- ui
Mailgun Email
, fill in a domain and API key (can be whatever value you want)With fix:
repeat steps 1-3, notice that the "test connection" field successfully renders and you are able to successfully submit a messaging connection test (assuming your messaging config details are valid).
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
TestMessagingProviderConnectionButton
constructor to just take aservice_type: string
(since that's all it really needs) but i couldn't get that to play nice in the forms on some quick tries - but i also don't know what i'm doing!