diff --git a/www/package.json b/www/package.json index 9961c68..48433b9 100644 --- a/www/package.json +++ b/www/package.json @@ -1,6 +1,6 @@ { "name": "sand", - "version": "2.2.2", + "version": "2.2.3", "private": true, "dependencies": { "@ant-design/colors": "^6.0.0", diff --git a/www/src/models/entity/EntityStore.ts b/www/src/models/entity/EntityStore.ts index d2fac28..0531516 100644 --- a/www/src/models/entity/EntityStore.ts +++ b/www/src/models/entity/EntityStore.ts @@ -1,7 +1,7 @@ import { RStore } from "gena-app"; import { SERVER } from "../../env"; import { Entity } from "./Entity"; -import axios, { AxiosRequestConfig } from "axios"; +import axios from "axios"; export interface EntityTextSearchResult { id: string; diff --git a/www/src/models/ontology/ClassStore.ts b/www/src/models/ontology/ClassStore.ts index f658d0a..d1338d0 100644 --- a/www/src/models/ontology/ClassStore.ts +++ b/www/src/models/ontology/ClassStore.ts @@ -1,7 +1,7 @@ import { RStore, SingleKeyUniqueIndex } from "gena-app"; import { action, makeObservable, observable, runInAction } from "mobx"; import { SERVER } from "../../env"; -import axios, { AxiosRequestConfig } from "axios"; +import axios from "axios"; export interface Class { id: string; diff --git a/www/src/models/transformation/TransformationStore.ts b/www/src/models/transformation/TransformationStore.ts index 94ca215..3d281d4 100644 --- a/www/src/models/transformation/TransformationStore.ts +++ b/www/src/models/transformation/TransformationStore.ts @@ -1,4 +1,4 @@ -import { SimpleCRUDStore, CRUDStore, Record } from "gena-app"; +import { CRUDStore, Record } from "gena-app"; import { SERVER } from "../../env"; import { TransformationResult } from "./TransformationResult"; import axios from "axios"; diff --git a/www/src/pages/table/NodeSearchComponent.tsx b/www/src/pages/table/NodeSearchComponent.tsx index 42f26f8..e975aa2 100644 --- a/www/src/pages/table/NodeSearchComponent.tsx +++ b/www/src/pages/table/NodeSearchComponent.tsx @@ -73,7 +73,7 @@ export const NodeSearchComponent = withStyles(styles)( for (const u of sm.graph.nodes) { if ( classAndLiteralSearchOnly && - !(u.nodetype == "class_node" || u.nodetype == "literal_node") + !(u.nodetype === "class_node" || u.nodetype === "literal_node") ) continue; options.push({ @@ -135,7 +135,7 @@ export const NodeSearchComponent = withStyles(styles)( className={classes.selection} showSearch={true} filterOption={(inputValue, option) => { - if (option!.type != "class") { + if (option!.type !== "class") { let label = option!.label!.toLowerCase(); return inputValue .toLowerCase() @@ -148,7 +148,7 @@ export const NodeSearchComponent = withStyles(styles)( onSearch={debounce(onSearch, 300)} value={value === undefined ? undefined : `${value.type}:${value.id}`} onSelect={(value: any, option: SearchOptions) => { - if (option.type == "class") { + if (option.type === "class") { classStore.fetchById(option.id).then(() => { onSelect({ type: option.type, id: option.id }); }); diff --git a/www/src/pages/table/OntSearchComponent.tsx b/www/src/pages/table/OntSearchComponent.tsx index 6214d83..3d0f02b 100644 --- a/www/src/pages/table/OntSearchComponent.tsx +++ b/www/src/pages/table/OntSearchComponent.tsx @@ -1,7 +1,7 @@ import { WithStyles, withStyles } from "@material-ui/styles"; import { Select, Spin } from "antd"; import { observer } from "mobx-react"; -import { useEffect, useMemo, useState } from "react"; +import { useState } from "react"; import { useStores } from "../../models"; import SearchOptionsComponent from "./SearchOptionsComponent"; import { debounce } from "lodash"; diff --git a/www/src/pages/table/forms/TransformationForm.tsx b/www/src/pages/table/forms/TransformationForm.tsx index 6327a68..1483bd1 100644 --- a/www/src/pages/table/forms/TransformationForm.tsx +++ b/www/src/pages/table/forms/TransformationForm.tsx @@ -2,9 +2,7 @@ import { Button, Radio, Tag, - Space, Table, - Modal, Form, Col, Row, @@ -12,8 +10,7 @@ import { InputNumber, } from "antd"; import { observer } from "mobx-react"; -import { ActionType } from "@ant-design/pro-table"; -import { useRef, useState } from "react"; +import { useState } from "react"; import Editor from "@monaco-editor/react"; import { TransformationResult, @@ -50,8 +47,8 @@ const editorOptions = { export const TransformationForm = observer( ({ table }: TransformationFormProps) => { - const onDone = () => Modal.destroyAll(); - const actionRef = useRef(); + // const onDone = () => Modal.destroyAll(); + // const actionRef = useRef(); const [form] = Form.useForm(); const { transformationStore } = useStores(); const [result, setResult] = useState(); @@ -84,19 +81,18 @@ export const TransformationForm = observer( ]; const onExecute = async () => { - const transformationPayload: - | DraftCreateTransformation - | Transformation = { - draftID: table.id.toString(), - id: -1, - tableId: table.id, - type: form.getFieldValue("type"), - code: form.getFieldValue("code"), - mode: "restrictedpython", - onError: form.getFieldValue("onerror"), - datapath: form.getFieldValue("datapath"), - outputpath: form.getFieldValue("outputpath"), - }; + const transformationPayload: DraftCreateTransformation | Transformation = + { + draftID: table.id.toString(), + id: -1, + tableId: table.id, + type: form.getFieldValue("type"), + code: form.getFieldValue("code"), + mode: "restrictedpython", + onError: form.getFieldValue("onerror"), + datapath: form.getFieldValue("datapath"), + outputpath: form.getFieldValue("outputpath"), + }; let response = await transformationStore.testTransformation( transformationPayload, diff --git a/www/src/pages/table/forms/index.tsx b/www/src/pages/table/forms/index.tsx index fe8bad6..5819c65 100644 --- a/www/src/pages/table/forms/index.tsx +++ b/www/src/pages/table/forms/index.tsx @@ -5,7 +5,6 @@ import { TransformationForm, TransformationFormProps, } from "./TransformationForm"; -import { Table } from "../../../models"; interface TypedEdgeFormProps extends EdgeFormProps { type: "edge"; diff --git a/www/src/pages/table/table/filters/TypeTreeFilter.tsx b/www/src/pages/table/table/filters/TypeTreeFilter.tsx index 4c355e8..16a920f 100644 --- a/www/src/pages/table/table/filters/TypeTreeFilter.tsx +++ b/www/src/pages/table/table/filters/TypeTreeFilter.tsx @@ -353,10 +353,6 @@ const flattenGraph = (types: { [id: string]: Class }, filter: ColumnFilter) => { const type2node: { [id: string]: number } = {}; const type2descendants: Record = {}; - let type2parents: { [id: string]: Set } = Object.fromEntries( - lstTypes.map((t) => [t.id, new Set(t.parents)]) - ); - for (const type of lstTypes) { type2node[type.id] = graph.addNode(type); }