Add server-side work item search
This commit is contained in:
@@ -114,6 +114,7 @@ pub struct IssueFilterOptions {
|
||||
pub unavailable_labels: Vec<String>,
|
||||
pub selected_milestone: String,
|
||||
pub selected_labels: Vec<String>,
|
||||
pub search_text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, uniffi::Record)]
|
||||
@@ -153,6 +154,7 @@ pub struct MilestoneEditorPage {
|
||||
pub struct PullFilterOptions {
|
||||
pub milestones: Vec<String>,
|
||||
pub selected_milestone: String,
|
||||
pub search_text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, uniffi::Record)]
|
||||
@@ -365,6 +367,7 @@ pub fn issue_filter_options(
|
||||
unavailable_labels,
|
||||
selected_milestone: filter.milestone.clone(),
|
||||
selected_labels: filter.labels.iter().cloned().collect(),
|
||||
search_text: filter.search_text.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,6 +422,7 @@ pub fn pull_filter_options(milestones: &[String], filter: &PullFilter) -> PullFi
|
||||
PullFilterOptions {
|
||||
milestones,
|
||||
selected_milestone: filter.milestone.clone(),
|
||||
search_text: filter.search_text.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1365,6 +1369,7 @@ mod tests {
|
||||
let filter = IssueFilter {
|
||||
milestone: "v3".into(),
|
||||
labels: ["bug".into(), "retired".into()].into(),
|
||||
search_text: "login".into(),
|
||||
};
|
||||
let options = issue_filter_options(
|
||||
&[
|
||||
@@ -1395,15 +1400,18 @@ mod tests {
|
||||
assert_eq!(options.milestones, ["v1", "v2", "v3"]);
|
||||
assert_eq!(options.selected_labels, ["bug", "retired"]);
|
||||
assert_eq!(options.selected_milestone, "v3");
|
||||
assert_eq!(options.search_text, "login");
|
||||
|
||||
let pull_options = pull_filter_options(
|
||||
&["v2".into(), "v1".into()],
|
||||
&PullFilter {
|
||||
milestone: "v3".into(),
|
||||
search_text: "review".into(),
|
||||
},
|
||||
);
|
||||
assert_eq!(pull_options.milestones, ["v1", "v2", "v3"]);
|
||||
assert_eq!(pull_options.selected_milestone, "v3");
|
||||
assert_eq!(pull_options.search_text, "review");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user