Skip to content

Commit

Permalink
fix conflicts caused by FilterMenu changes to Tool panel struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Oct 14, 2023
1 parent 2ea5170 commit a418224
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 427 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Panels/Common/ToolSearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("ToolSearch", () => {
const filterInputs = {
"[placeholder='any name']": "name-filter",
"[placeholder='any section']": "section-filter",
"[placeholder='any ontology']": "ontology-filter",
"[placeholder='any EDAM ontology']": "ontology-filter",
"[placeholder='any id']": "id-filter",
"[placeholder='any repository owner']": "owner-filter",
"[placeholder='any help text']": "help-filter",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Panels/Common/ToolSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const validFilters: ComputedRef<Record<string, ValidFilter<string>>> = computed(
return {
name: { placeholder: "name", type: String, handler: contains("name"), menuItem: true },
section: {
placeholder: props.currentPanelView === "default" ? "section" : "ontology",
placeholder: "section",
type: String,
handler: contains("section"),
datalist: sectionNames,
Expand Down
345 changes: 0 additions & 345 deletions client/src/components/Panels/utilities.js

This file was deleted.

12 changes: 10 additions & 2 deletions client/src/components/Panels/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ const UNSECTIONED_SECTION = {
};
const VALID_SECTION_TYPES = ["edam_operations", "edam_topics"]; // other than `default`

/** These are keys used to order/sort results in `ToolSearch`.
* The value for each is the sort order, higher number = higher rank.
* Must include some `Tool` properties (like name, description, id etc.)
* to check against query, and any other keys below are special, used for
* specific cases (like `combined` for name+description).
*/
export interface ToolSearchKeys {
[key: string | keyof Tool]: number | undefined;
/** property has exact match with query */
exact?: number;
/** property starts with query */
startsWith?: number;
name?: number;
description?: number;
/** query contains matches `Tool.name + Tool.description` */
combined?: number;
/** property matches */
wordMatch?: number;
}

Expand Down
Loading

0 comments on commit a418224

Please sign in to comment.