From 4b363cec36f803549146509b86cd7d48c135902d Mon Sep 17 00:00:00 2001 From: Robin Shen Date: Tue, 22 Oct 2024 20:58:12 +0800 Subject: [PATCH] chore: Improve various search help --- .../java/io/onedev/server/web/behavior/AgentQueryBehavior.java | 2 +- .../java/io/onedev/server/web/behavior/BuildQueryBehavior.java | 2 +- .../io/onedev/server/web/behavior/CodeCommentQueryBehavior.java | 2 +- .../java/io/onedev/server/web/behavior/CommitQueryBehavior.java | 2 +- .../java/io/onedev/server/web/behavior/IssueQueryBehavior.java | 2 +- .../java/io/onedev/server/web/behavior/PackQueryBehavior.java | 2 +- .../io/onedev/server/web/behavior/ProjectQueryBehavior.java | 2 +- .../io/onedev/server/web/behavior/PullRequestQueryBehavior.java | 2 +- .../onedev/server/web/component/build/list/BuildListPanel.java | 1 + .../server/web/component/codecomment/CodeCommentListPanel.java | 1 + .../server/web/component/commit/list/CommitListPanel.java | 1 + .../onedev/server/web/component/issue/list/IssueListPanel.java | 1 + .../io/onedev/server/web/component/pack/list/PackListPanel.java | 1 + .../server/web/component/project/list/ProjectListPanel.java | 1 + .../web/component/pullrequest/list/PullRequestListPanel.java | 1 + .../web/page/admin/buildsetting/agent/AgentListPanel.java | 1 + 16 files changed, 16 insertions(+), 8 deletions(-) diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/AgentQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/AgentQueryBehavior.java index 8ba4058c60..76cc0a5940 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/AgentQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/AgentQueryBehavior.java @@ -31,7 +31,7 @@ @SuppressWarnings("serial") public class AgentQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final boolean forExecutor; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/BuildQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/BuildQueryBehavior.java index 3a91fd993a..52b0619726 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/BuildQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/BuildQueryBehavior.java @@ -33,7 +33,7 @@ @SuppressWarnings("serial") public class BuildQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/CodeCommentQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/CodeCommentQueryBehavior.java index 6c6cc423e7..69862087a6 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/CodeCommentQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/CodeCommentQueryBehavior.java @@ -31,7 +31,7 @@ @SuppressWarnings("serial") public class CodeCommentQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/CommitQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/CommitQueryBehavior.java index d30ee2ddb8..214dad4557 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/CommitQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/CommitQueryBehavior.java @@ -32,7 +32,7 @@ @SuppressWarnings("serial") public class CommitQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/IssueQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/IssueQueryBehavior.java index 7408887c87..3bca5d55d1 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/IssueQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/IssueQueryBehavior.java @@ -49,7 +49,7 @@ @SuppressWarnings("serial") public class IssueQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/PackQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/PackQueryBehavior.java index 1e6d71c4f7..00ca305492 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/PackQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/PackQueryBehavior.java @@ -33,7 +33,7 @@ @SuppressWarnings("serial") public class PackQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/ProjectQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/ProjectQueryBehavior.java index f8531e9755..5b456f397e 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/ProjectQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/ProjectQueryBehavior.java @@ -37,7 +37,7 @@ @SuppressWarnings("serial") public class ProjectQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final boolean childQuery; diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/PullRequestQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/PullRequestQueryBehavior.java index 970daa6544..603c97e16e 100644 --- a/server-core/src/main/java/io/onedev/server/web/behavior/PullRequestQueryBehavior.java +++ b/server-core/src/main/java/io/onedev/server/web/behavior/PullRequestQueryBehavior.java @@ -34,7 +34,7 @@ @SuppressWarnings("serial") public class PullRequestQueryBehavior extends ANTLRAssistBehavior { - private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "surround with ~"; + private static final String FUZZY_SUGGESTION_DESCRIPTION_PREFIX = "enclose with ~"; private final IModel projectModel; diff --git a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java index 3068ca64c3..b7ed92a709 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java @@ -161,6 +161,7 @@ private BuildQuery parse(@Nullable String queryString, BuildQuery baseQuery) { error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and successful"); parsedQuery = new BuildQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/codecomment/CodeCommentListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/codecomment/CodeCommentListPanel.java index 4fa80dae25..d121dc2c8e 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/codecomment/CodeCommentListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/codecomment/CodeCommentListPanel.java @@ -94,6 +94,7 @@ protected CodeCommentQuery load() { error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and unresolved"); return new CodeCommentQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java index ee3a6aba80..60ed79ca81 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/commit/list/CommitListPanel.java @@ -99,6 +99,7 @@ protected CommitQuery load() { error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and author(robin)"); parsedQuery = new CommitQuery(Lists.newArrayList(new FuzzyCriteria(Lists.newArrayList(queryString)))); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java index 0ad225c668..7385d604f7 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java @@ -183,6 +183,7 @@ private IssueQuery parse(@Nullable String queryString, IssueQuery baseQuery) { error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and \"State\" is \"Open\""); parsedQuery = new IssueQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java index e8ddab5487..b7e9bff602 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java @@ -125,6 +125,7 @@ private PackQuery parse(@Nullable String queryString, PackQuery baseQuery, @Null error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and \"Type\" is \"NPM\""); parsedQuery = new PackQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java index a0b4546b0d..76082dee1f 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java @@ -1258,6 +1258,7 @@ private ProjectQuery parse(@Nullable String queryString, ProjectQuery baseQuery) error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and owned by me"); parsedQuery = new ProjectQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java index 37500ed2b3..67d8dcf64e 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java @@ -161,6 +161,7 @@ private PullRequestQuery parse(@Nullable String queryString, PullRequestQuery ba error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and open"); parsedQuery = new PullRequestQuery(new FuzzyCriteria(queryString)); } } diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentListPanel.java b/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentListPanel.java index 6cfcd6e76f..982c91d3d3 100644 --- a/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/page/admin/buildsetting/agent/AgentListPanel.java @@ -77,6 +77,7 @@ protected AgentQuery load() { error(e.getMessage()); return null; } else { + info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and online"); return new AgentQuery(new FuzzyCriteria(queryString)); } }