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

Implement organization support in unified search and fix bugs identified via integration tests #12717

Open
wants to merge 7 commits into
base: org_visibility
Choose a base branch
from

Conversation

RusJaI
Copy link
Contributor

@RusJaI RusJaI commented Dec 4, 2024

@RusJaI RusJaI force-pushed the org_visibility branch 2 times, most recently from bdca0eb to 134262e Compare December 12, 2024 08:45
@RusJaI RusJaI changed the title Implement organization support in unified search Implement organization support in unified search and fix bugs identified via integration tests Dec 14, 2024
@@ -4200,13 +4225,6 @@ public Map<String, Object> searchPaginatedContent(String searchQuery, String org
List<APIDefinitionContentSearchResult> defSearchList = new ArrayList<>();
int totalLength = 0;

String userame = (userNameWithoutChange != null) ? userNameWithoutChange : username;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have to remove this section? maybe we could keep this code unchanged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That code block is not removed. Instead preserved the previous logic as it is and introduced a separate function for org visibility enabled flow

String artifactPath = GovernanceUtils.getArtifactPath(registry, apiId);

//get API
Resource apiResource = registry.get(artifactPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

In this method, we do couple of registry get actions to get the API's organization. I think we could pass the organization visibility from the method calling location instead of doing multiple registry calls. For example, API artifact is already retrieved in https://github.com/wso2/carbon-apimgt/pull/12717/files#diff-e193f41af36b63c9f226e35c981eeae30ee45850c880876c502785b547dbe00cR2635. you could get the organization information there and pass it to this method

devportalFilterQueryField = VISIBLE_ORGANIZATIONS;
devportalFilterQuery = keyVal[1];
} else {
devportalFilterQuery += (" AND visible_organizations_ss:" + keyVal[1]);
Copy link
Contributor

Choose a reason for hiding this comment

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

lets use constants here.

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.

2 participants