-
Notifications
You must be signed in to change notification settings - Fork 259
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
base: master
Are you sure you want to change the base?
Remove the idvp image URL from the API request body. #7101
Conversation
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. |
@@ -314,7 +319,7 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI | |||
> | |||
{ | |||
<EditIdentityVerificationProvider | |||
identityVerificationProvider={ fetchedIdVP } | |||
identityVerificationProvider={ { ...fetchedIdVP } } |
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.
Why do we need to additional spreading here?
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.
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.
@@ -103,6 +105,9 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI | |||
const hasIdVPDeletePermissions: boolean = useRequiredScopes( | |||
featureConfig?.identityVerificationProviders?.scopes?.delete); | |||
|
|||
const { UIConfig } = useUIConfig(); | |||
const connectionResourcesUrl: string = UIConfig?.connectionResourcesUrl; |
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.
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)
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.
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
.
Purpose
Related Issues
Related PRs
Todo
Checklist
Security checks