Skip to content

Commit

Permalink
1927 - optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
kresimir-coko committed Jan 18, 2025
1 parent 2388557 commit 6a52216
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {Editor} from '@tiptap/react';
import {usePrevious} from '@uidotdev/usehooks';
import {decode} from 'html-entities';
import resolvePath from 'object-resolve-path';
import {ChangeEvent, ReactNode, useEffect, useMemo, useRef, useState} from 'react';
import {ChangeEvent, ReactNode, useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {Control, Controller, FieldValues, FormState} from 'react-hook-form';
import sanitizeHtml from 'sanitize-html';
import {TYPE_ICONS} from 'shared/typeIcons';
Expand Down Expand Up @@ -121,7 +121,7 @@ const Property = ({
const inputRef = useRef<HTMLInputElement>(null);
const latestValueRef = useRef<string | number | undefined>(property.defaultValue || '');

const {currentComponent, currentNode, setCurrentComponent, setFocusedInput, workflowNodeDetailsPanelOpen} =
const {currentComponent, currentNode, setFocusedInput, workflowNodeDetailsPanelOpen} =
useWorkflowNodeDetailsPanelStore();
const {setDataPillPanelOpen} = useDataPillPanelStore();
const {workflow} = useWorkflowDataStore();
Expand Down Expand Up @@ -298,15 +298,12 @@ const Property = ({
});
}, 200);

const handleDeleteCustomPropertyClick = (path: string) => {
deleteProperty(
workflow.id!,
path,
currentComponent!,
setCurrentComponent,
deleteWorkflowNodeParameterMutation!
);
};
const handleDeleteCustomPropertyClick = useCallback(
(path: string) => {
deleteProperty(workflow.id!, path!, deleteWorkflowNodeParameterMutation!);
},
[deleteWorkflowNodeParameterMutation, workflow.id]
);

const handleJsonSchemaBuilderChange = useDebouncedCallback((value?: SchemaRecordType) => {
if (!currentComponent || !name || !path || !updateWorkflowNodeParameterMutation || !workflow.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import {
UpdateWorkflowNodeParameter200Response,
UpdateWorkflowNodeParameterOperationRequest,
} from '@/shared/middleware/platform/configuration';
import {ComponentType} from '@/shared/types';
import {UseMutationResult} from '@tanstack/react-query';
import useWorkflowNodeDetailsPanelStore from '../stores/useWorkflowNodeDetailsPanelStore';

import useWorkflowNodeDetailsPanelStore from '../stores/useWorkflowNodeDetailsPanelStore';
import {decodePath} from './encodingUtils';

interface SavePropertyProps {
Expand Down

0 comments on commit 6a52216

Please sign in to comment.