Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

feat: LOPS-134: [FE] find similar CandidateTasks #222

Merged
merged 8 commits into from
Sep 15, 2023
7 changes: 7 additions & 0 deletions src/components/Filters/types/String.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { observer } from "mobx-react";
import React from "react";
import { FilterInput } from "../FilterInput";
import { VariantSelect } from "./List";

const BaseInput = observer(({ value, onChange, placeholder }) => {
return (
Expand Down Expand Up @@ -45,4 +46,10 @@ export const StringFilter = [
valueType: "single",
input: (props) => <BaseInput {...props} />,
},
{
key: "similar_to",
label: "similar to",
valueType: "list",
input: (props) => <VariantSelect {...props} />,
},
];
1 change: 1 addition & 0 deletions src/components/Filters/types/Utility.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const EXCLUDED_FILTER_OPERATIONS = {
"DE": ["contains", "not_contains", "regex"],
"dm": ["similar_to"],
};

export const allowedFilterOperations = (operationsList, context = "") => {
Expand Down
12 changes: 6 additions & 6 deletions src/stores/Tabs/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { TabHiddenColumns } from "./tab_hidden_columns";
import { TabSelectedItems } from "./tab_selected_items";
import { History } from '../../utils/history';
import { FF_LOPS_12, isFF } from "../../utils/feature-flags";
import { StringOrNumberID } from "../types";
import { CustomJSON, StringOrNumberID } from "../types";

export const Tab = types
.model("View", {
Expand Down Expand Up @@ -50,7 +50,7 @@ export const Tab = types
locked: false,
editable: true,
deletable: true,
search_text: types.optional(types.maybeNull(types.string), null),
semantic_search: types.optional(types.array(CustomJSON), []),
})
.volatile(() => {
const defaultWidth = getComputedStyle(document.body).getPropertyValue("--menu-sidebar-width").replace("px", "").trim();
Expand Down Expand Up @@ -214,7 +214,7 @@ export const Tab = types
columnsWidth: self.columnsWidth.toPOJO(),
columnsDisplayType: self.columnsDisplayType.toPOJO(),
gridWidth: self.gridWidth,
search_text: self.search_text,
semantic_search: self.semantic_search?.toJSON() ?? [],
};

if (self.saved || apiVersion === 1) {
Expand Down Expand Up @@ -301,9 +301,9 @@ export const Tab = types
self.selected = ids;
},

setSearchText(searchText) {
self.search_text = searchText;
self.save();
setSemanticSearch(semanticSearchList) {
self.semantic_search = semanticSearchList ?? [];
return self.save();
},

selectAll() {
Expand Down