Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Binh Vu committed Feb 13, 2024
1 parent 6326d5a commit d26e89a
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 32 deletions.
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sand",
"version": "2.2.2",
"version": "2.2.3",
"private": true,
"dependencies": {
"@ant-design/colors": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion www/src/models/entity/EntityStore.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion www/src/models/ontology/ClassStore.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion www/src/models/transformation/TransformationStore.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
6 changes: 3 additions & 3 deletions www/src/pages/table/NodeSearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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()
Expand All @@ -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 });
});
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/table/OntSearchComponent.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
34 changes: 15 additions & 19 deletions www/src/pages/table/forms/TransformationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ import {
Button,
Radio,
Tag,
Space,
Table,
Modal,
Form,
Col,
Row,
Select,
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,
Expand Down Expand Up @@ -50,8 +47,8 @@ const editorOptions = {

export const TransformationForm = observer(
({ table }: TransformationFormProps) => {
const onDone = () => Modal.destroyAll();
const actionRef = useRef<ActionType>();
// const onDone = () => Modal.destroyAll();
// const actionRef = useRef<ActionType>();
const [form] = Form.useForm();
const { transformationStore } = useStores();
const [result, setResult] = useState<TransformationResult[] | undefined>();
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion www/src/pages/table/forms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
TransformationForm,
TransformationFormProps,
} from "./TransformationForm";
import { Table } from "../../../models";

interface TypedEdgeFormProps extends EdgeFormProps {
type: "edge";
Expand Down
4 changes: 0 additions & 4 deletions www/src/pages/table/table/filters/TypeTreeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ const flattenGraph = (types: { [id: string]: Class }, filter: ColumnFilter) => {
const type2node: { [id: string]: number } = {};
const type2descendants: Record<string, string[]> = {};

let type2parents: { [id: string]: Set<string> } = Object.fromEntries(
lstTypes.map((t) => [t.id, new Set(t.parents)])
);

for (const type of lstTypes) {
type2node[type.id] = graph.addNode(type);
}
Expand Down

0 comments on commit d26e89a

Please sign in to comment.