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

Fix server host resolving issue in rule get resources api #7450

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

ashanthamara
Copy link
Contributor

@ashanthamara ashanthamara commented Jan 29, 2025

Purpose

  • Fix server host resolving issue in rule component

@wso2-jenkins-bot
Copy link
Contributor

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.98%. Comparing base (410739b) to head (1d6cd65).
Report is 25 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7450   +/-   ##
=======================================
  Coverage   41.98%   41.98%           
=======================================
  Files          42       42           
  Lines         936      936           
  Branches      214      233   +19     
=======================================
  Hits          393      393           
+ Misses        543      499   -44     
- Partials        0       44   +44     
Flag Coverage Δ
@wso2is/core 41.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 12 files with indirect coverage changes

@@ -44,7 +44,7 @@ const useGetResourcesList = <Data = any, Error = RequestErrorInterface>(
"Content-Type": "application/json"
},
method: HttpMethods.GET,
url: store.getState().config.deployment.idpConfigs.serverOrigin + `/api/server/v1${endpointPath}`
url: Config.resolveServerHost() + `/api/server/v1${endpointPath}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason we haven't taken these values from the endpoint configuration? Ex:- https://github.com/wso2/identity-apps/blob/master/features/admin.applications.v1/configs/endpoints.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot hard code the path here as this api is designed to invoke any given endpoint. That endpoint path can be vary depends on the scenario.

The api path is resolved from the ruleMeta Api.
image

Copy link
Contributor

Choose a reason for hiding this comment

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

I think still we can define the static part in endpoint.ts file. Then you can change the endpoint path dynamically like the following logic.

store.getState().config.endpoints.actions.youendpoint + dynamicEndpoint

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is urgent, let's send the fix now and refactor the code in a separate PR.

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