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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the idvp image URL from the API request body. #7101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AfraHussaindeen
Copy link
Contributor

@AfraHussaindeen AfraHussaindeen commented Nov 8, 2024

Purpose

  • Remove the idvp image URL from the API request body.
  • Additionally add the onfido logo

Related Issues

Related PRs

Todo

  • Add the latest onfido logo. (Already made a request from onfido side)

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@wso2-jenkins-bot
Copy link
Contributor

⚠️ No Changeset found

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.

If these changes should result in a version bump, you need to add a changeset.

Refer Release Documentation to learn how to add a changeset.

@@ -314,7 +319,7 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI
>
{
<EditIdentityVerificationProvider
identityVerificationProvider={ fetchedIdVP }
identityVerificationProvider={ { ...fetchedIdVP } }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to additional spreading here?

Copy link
Contributor Author

@AfraHussaindeen AfraHussaindeen Nov 10, 2024

Choose a reason for hiding this comment

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

The additional spreading ({ ...fetchedIdVP }) is needed because, with the latest API change, the PUT request to update identity verification provider details (/api/server/v1/idv-providers/{idv-provider-id}[1]) no longer includes the img URL in the payload (Refer wso2/identity-api-server#727). To accommodate this, we need to remove the img URL before making the API call. However, directly deleting it from the original fetchedIdVP object would also impact the UI after the update, as the icon would disappear without the img URL.

By spreading fetchedIdVP into a new object, we create a separate copy that allows us to remove the img URL specifically for the API call while keeping the original fetchedIdVP intact. This way, the UI retains the img URL and displays the icon correctly after the update, preventing any unintended changes in the displayed data.

[1] https://is.docs.wso2.com/en/next/apis/identity-verification-providers/#tag/Identity-Verification-Providers/operation/updateIdVProviders

@@ -103,6 +105,9 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI
const hasIdVPDeletePermissions: boolean = useRequiredScopes(
featureConfig?.identityVerificationProviders?.scopes?.delete);

const { UIConfig } = useUIConfig();
const connectionResourcesUrl: string = UIConfig?.connectionResourcesUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we are getting the base path for connection resources, aren't we? if yes, let's update the variable name to reflect that. (eg: connectionImageBasePath)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we’re getting the base path and identity verification providers fall under "connections," it aligns with existing conventions to use connectionResourcesUrl, as this is the same approach used in authenticators.

Example :

? ConnectionsManagementUtils.resolveConnectionResourcePath(connectionResourcesUrl, connection.image)

Hence IMO it would be better to stick to connectionResourcesUrl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants