From ff76c648a921bf1a06ae0ae4cddc34dbc92e8bc4 Mon Sep 17 00:00:00 2001 From: klakhov Date: Fri, 23 Jun 2023 08:59:09 +0300 Subject: [PATCH] removed outdated code, removed submit and open --- cvat-core/src/quality-settings.ts | 33 ------------------- cvat-core/src/server-proxy.ts | 8 ++--- .../components/create-job-page/job-form.tsx | 24 +------------- 3 files changed, 3 insertions(+), 62 deletions(-) diff --git a/cvat-core/src/quality-settings.ts b/cvat-core/src/quality-settings.ts index eba281056..2ff4ab900 100644 --- a/cvat-core/src/quality-settings.ts +++ b/cvat-core/src/quality-settings.ts @@ -39,23 +39,6 @@ export default class QualitySettings { #compareAttributes: boolean; constructor(initialData: SerializedQualitySettingsData) { - const data: SerializedQualitySettingsData = { - id: undefined, - task: undefined, - iou_threshold: undefined, - oks_sigma: undefined, - line_thickness: undefined, - low_overlap_threshold: undefined, - compare_line_orientation: undefined, - line_orientation_threshold: undefined, - compare_groups: undefined, - group_match_threshold: undefined, - check_covered_annotations: undefined, - object_visibility_threshold: undefined, - panoptic_comparison: undefined, - compare_attributes: undefined, - }; - this.#id = initialData.id; this.#task = initialData.task; this.#iouThreshold = initialData.iou_threshold; @@ -70,22 +53,6 @@ export default class QualitySettings { this.#objectVisibilityThreshold = initialData.object_visibility_threshold; this.#panopticComparison = initialData.panoptic_comparison; this.#compareAttributes = initialData.compare_attributes; - - for (const property in data) { - if (Object.prototype.hasOwnProperty.call(data, property) && property in initialData) { - data[property] = initialData[property]; - } - } - - Object.defineProperties( - this, - Object.freeze({ - id: { - get: () => data.id, - }, - - }), - ); } get id(): number { diff --git a/cvat-core/src/server-proxy.ts b/cvat-core/src/server-proxy.ts index a7efe3352..ac9f8ccbd 100644 --- a/cvat-core/src/server-proxy.ts +++ b/cvat-core/src/server-proxy.ts @@ -2201,13 +2201,11 @@ async function receiveWebhookEvents(type: WebhookSourceType): Promise } async function getQualityReports(filter): Promise { - const params = enableOrganization(); const { backendAPI } = config; try { const response = await Axios.get(`${backendAPI}/quality/reports`, { params: { - ...params, ...filter, }, }); @@ -2235,18 +2233,16 @@ async function getQualityConflicts(filter): Promise { - const params = enableOrganization(); const { backendAPI } = config; try { const response = await Axios.get(`${backendAPI}/quality/settings`, { params: { - ...params, task_id: taskID, }, }); - const settings = response.data.results[0]; - return settings; + + return response.data.results[0]; } catch (errorData) { throw generateError(errorData); } diff --git a/cvat-ui/src/components/create-job-page/job-form.tsx b/cvat-ui/src/components/create-job-page/job-form.tsx index f452f7f06..0054aba2c 100644 --- a/cvat-ui/src/components/create-job-page/job-form.tsx +++ b/cvat-ui/src/components/create-job-page/job-form.tsx @@ -9,7 +9,6 @@ import { Row, Col } from 'antd/lib/grid'; import Form from 'antd/lib/form'; import Button from 'antd/lib/button'; import Select from 'antd/lib/select'; -import notification from 'antd/lib/notification'; import InputNumber from 'antd/lib/input-number'; import CVATTooltip from 'components/common/cvat-tooltip'; @@ -75,24 +74,13 @@ function JobForm(props: Props): JSX.Element { } }, [task]); - const onSubmitAndOpen = async (): Promise => { + const onSubmit = async (): Promise => { const createdJob = await submit(); if (createdJob) { history.push(`/tasks/${task.id}/jobs/${createdJob.id}`); } }; - const onSubmit = async (): Promise => { - const res = await submit(); - if (res) { - form.resetFields(); - notification.info({ - message: 'Job has been successfully created', - className: 'cvat-notification-create-job-success', - }); - } - }; - const onQuantityChange = useCallback((value: number | null) => { if (value) { const newFrameCount = Math.round((value * taskSize) / 100); @@ -222,16 +210,6 @@ function JobForm(props: Props): JSX.Element { - - -