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

Commit

Permalink
feat: LOPS-134: [FE] find similar CandidateTasks (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyassi-heartex authored Sep 15, 2023
1 parent 98e5c9e commit b7ba76a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
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

0 comments on commit b7ba76a

Please sign in to comment.