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 issue in searching app inside folder. #1391

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public Mono<Void> upsertLastViewTime(@Nullable String folderId) {
*/
@Override
public Flux<?> getElements(@Nullable String folderId, @Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category) {
return buildApplicationInfoViewTree(applicationType, name, category)
return buildApplicationInfoViewTree(applicationType, name, category, folderId)
.flatMap(tree -> {
FolderNode<ApplicationInfoView, FolderInfoView> folderNode = tree.get(folderId);
if (folderNode == null) {
Expand Down Expand Up @@ -278,7 +278,7 @@ private Mono<Tree<Object, Folder>> buildFolderTree(String orgId) {
.map(folders -> new Tree<>(folders, Folder::getId, Folder::getParentFolderId, Collections.emptyList(), null, null));
}

private Mono<Tree<ApplicationInfoView, FolderInfoView>> buildApplicationInfoViewTree(@Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category) {
private Mono<Tree<ApplicationInfoView, FolderInfoView>> buildApplicationInfoViewTree(@Nullable ApplicationType applicationType, @Nullable String name, @Nullable String category, @Nullable String folderId) {

Mono<OrgMember> orgMemberMono = sessionUserService.getVisitorOrgMemberCache()
.cache();
Expand All @@ -296,7 +296,8 @@ private Mono<Tree<ApplicationInfoView, FolderInfoView>> buildApplicationInfoView
Flux<Folder> folderFlux = orgMemberMono.flatMapMany(orgMember -> folderService.findByOrganizationId(orgMember.getOrgId()))
.filter(folder -> name == null || StringUtils.containsIgnoreCase(folder.getName(), name)
|| StringUtils.containsIgnoreCase(folder.getType(), name)
|| StringUtils.containsIgnoreCase(folder.getDescription(), name))
|| StringUtils.containsIgnoreCase(folder.getDescription(), name)
|| StringUtils.containsIgnoreCase(folder.getId(), folderId))
.cache();

Mono<Map<String, Instant>> folderId2LastViewTimeMapMono = orgMemberMono
Expand Down
Loading