Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTPPCPSDK-2227: Return V2 Variables from getHostedButtonDetails 馃懢 #2385

Merged
merged 6 commits into from May 2, 2024

Conversation

spencersablan
Copy link
Contributor

Description

  • 馃 Prepares us for the NCPS 2.0 changes - All we need to do for this PR is extract those variables from the response to prepare for future changes.
  • 馃摑 Added tests for v2 response - Since we need to support both V1 & V2 responses from /ncp/api/form-fields/, I added some quick unit tests to make sure getHostedButtonDetails can handle either response appropriately.

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

JIRA: DTPPCPSDK-2227

Reproduction Steps (if applicable)

Screenshots (if applicable)

Dependent Changes (if applicable)

Groups who should review (if applicable)

鉂わ笍 Thank you!

@spencersablan spencersablan requested a review from a team as a code owner May 1, 2024 18:40
Copy link
Member

@jshawl jshawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@imbrian imbrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment re: preference types

@@ -34,6 +34,11 @@ export type HostedButtonsInstance = {|
render: (string | HTMLElement) => Promise<void>,
|};

export type HostedButtonPreferences = {|
buttonPreferences: $ReadOnlyArray<string>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible to narrow these string types to known preferences and sources? Could do that in follow-up implementation PR too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Donezo funzo

Copy link
Contributor

@nbierdeman nbierdeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 馃 馃殌 Should we add tagline to the tests?

@imbrian
Copy link
Contributor

imbrian commented May 2, 2024

Nice! 馃 馃殌 Should we add tagline to the tests?

tagline isn't implemented; fix is here, but waiting for @spencersablan to merge this to deal with conflicts on that branch.

@spencersablan spencersablan merged commit b7f986a into main May 2, 2024
3 checks passed
@spencersablan spencersablan deleted the feature/ncps-variables branch May 2, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants