-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sovrn connector UI #2579
Sovrn connector UI #2579
Conversation
if (step) { | ||
setSelectedItem( | ||
connector?.options[Number(step.stepId) - connector.options.length] | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really could not figure out the purpose of this line, and it caused a bug when there's only one tab available, so I got rid of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bravo tracking this down!
useEffect(() => { | ||
mounted.current = true; | ||
if (connectionOption?.type !== SystemType.MANUAL) { | ||
setSkip(false); | ||
} | ||
return () => { | ||
mounted.current = false; | ||
}; | ||
}, [connectionOption?.type]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this useEffect
+ skip pattern was hard to follow, so I refactored it and it seems to still work well
@@ -36,19 +39,14 @@ type ConnectorParametersProps = { | |||
onTestConnectionClick: (value: any) => void; | |||
}; | |||
|
|||
export const ConnectorParameters: React.FC<ConnectorParametersProps> = ({ | |||
data, | |||
export const useDatabaseConnector = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted this to a hook because the email connector uses the same API logic
} | ||
return defaultValues; | ||
return fillInDefaults(initialValues, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically an effort to remove duplicate code (note the two Object.entries()...
that are the same above) and also to extract to a function that is tested
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## fides_2394_sovrn_connector #2579 +/- ##
=============================================================
Coverage ? 86.05%
=============================================================
Files ? 289
Lines ? 15760
Branches ? 1983
=============================================================
Hits ? 13562
Misses ? 1818
Partials ? 380 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Oh actually I forgot I still need to fix the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allisonking could you actually change this so it makes a request that looks something like this? My latest commit on the backend branch yesterday where I change the expected format expects the advanced settings block.
{
"recipient_email_address": "dawn@ethyca.com",
"test_email_address": "dawn@ethyca.com",
"advanced_settings": {
"identity_types": {
"email": false,
"phone_number": false,
"cookie_ids": []
}
}
}
Passing run #108 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I can't easily review the code, I QA'd this and it looks great to me. Nice with the one tab so DatasetConfigs aren't created. Thanks again for stubbing out the API response for now.
You're welcome to merge this into my backend base branch when ready!
Thanks @pattisdr ! requesting @TheAndrewJackson to review the code part. I think you've done the hard part of QA-ing it, so hopefully Andrew can just look through the code (not that that is easy either, sorry for all the changes... it took me a long time to wrap my head around how the connectors stuff worked) |
Closes #2458
Code Changes
There was unfortunately quite a bit of tech debt in this section of code with typescript being ignored and other eslint workarounds. I couldn't resist fixing it up (also because things were confusing me). These were:
skip
logic on querying for connection schemaActual feature changes
handleSubmit
code as the Database type connector parameter, so I did some refactoring so they could both use the same logicSteps to Confirm
This is probably best QA'd alongside #2582
If you make a separate branch out of this one plus #2582, then you should be able to go through the whole flow:
Because we can't pass in the ljt_readerID from the frontend yet, cache a fake one in the request runner service...
, do the following:Add a sovrn consent email connector via the API
:Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
Write some things here about the changes and any potential caveats