diff --git a/web/app/components/base/icons/assets/vender/line/layout/layout-grid-02.svg b/web/app/components/base/icons/assets/vender/line/layout/layout-grid-02.svg new file mode 100644 index 0000000000..7a39660d8e --- /dev/null +++ b/web/app/components/base/icons/assets/vender/line/layout/layout-grid-02.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/app/components/base/icons/assets/vender/solid/communication/edit-list.svg b/web/app/components/base/icons/assets/vender/solid/communication/edit-list.svg new file mode 100644 index 0000000000..e6fdc2d06e --- /dev/null +++ b/web/app/components/base/icons/assets/vender/solid/communication/edit-list.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.json b/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.json new file mode 100644 index 0000000000..d71e981723 --- /dev/null +++ b/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.json @@ -0,0 +1,29 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "24", + "height": "24", + "viewBox": "0 0 24 24", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3 9H21M3 15H21M12 3V21M7.8 3H16.2C17.8802 3 18.7202 3 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C21 5.27976 21 6.11984 21 7.8V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V7.8C3 6.11984 3 5.27976 3.32698 4.63803C3.6146 4.07354 4.07354 3.6146 4.63803 3.32698C5.27976 3 6.11984 3 7.8 3Z", + "stroke": "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round" + }, + "children": [] + } + ] + }, + "name": "LayoutGrid02" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.tsx b/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.tsx new file mode 100644 index 0000000000..4613112e76 --- /dev/null +++ b/web/app/components/base/icons/src/vender/line/layout/LayoutGrid02.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './LayoutGrid02.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'LayoutGrid02' + +export default Icon diff --git a/web/app/components/base/icons/src/vender/line/layout/index.ts b/web/app/components/base/icons/src/vender/line/layout/index.ts index 20292e64e5..7c12b1f58f 100644 --- a/web/app/components/base/icons/src/vender/line/layout/index.ts +++ b/web/app/components/base/icons/src/vender/line/layout/index.ts @@ -1,3 +1,4 @@ export { default as AlignLeft01 } from './AlignLeft01' export { default as AlignRight01 } from './AlignRight01' export { default as Grid01 } from './Grid01' +export { default as LayoutGrid02 } from './LayoutGrid02' diff --git a/web/app/components/base/icons/src/vender/solid/communication/EditList.json b/web/app/components/base/icons/src/vender/solid/communication/EditList.json new file mode 100644 index 0000000000..436f0be9f3 --- /dev/null +++ b/web/app/components/base/icons/src/vender/solid/communication/EditList.json @@ -0,0 +1,53 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "24", + "height": "24", + "viewBox": "0 0 24 24", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3.00195 4C3.00195 3.44772 3.44967 3 4.00195 3H20.002C20.5542 3 21.002 3.44772 21.002 4C21.002 4.55228 20.5542 5 20.002 5H4.00195C3.44967 5 3.00195 4.55228 3.00195 4Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3.00195 8C3.00195 7.44772 3.44967 7 4.00195 7H10.502C11.0542 7 11.502 7.44772 11.502 8C11.502 8.55228 11.0542 9 10.502 9H4.00195C3.44967 9 3.00195 8.55228 3.00195 8Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M4 11C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H7.0022C7.55448 13 8.0022 12.5523 8.0022 12C8.0022 11.4477 7.55448 11 7.0022 11H4Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M19.2584 8.70705C18.0868 7.53548 16.1873 7.53547 15.0158 8.70705L7.29485 16.428C7.10731 16.6155 7.00195 16.8699 7.00195 17.1351V20.9999C7.00195 21.5522 7.44967 21.9999 8.00195 21.9999H11.8668C12.132 21.9999 12.3864 21.8946 12.5739 21.7071L20.2948 13.9861C21.4664 12.8146 21.4664 10.9151 20.2948 9.74349L19.2584 8.70705Z", + "fill": "currentColor" + }, + "children": [] + } + ] + }, + "name": "EditList" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/vender/solid/communication/EditList.tsx b/web/app/components/base/icons/src/vender/solid/communication/EditList.tsx new file mode 100644 index 0000000000..32eb8a7f5a --- /dev/null +++ b/web/app/components/base/icons/src/vender/solid/communication/EditList.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './EditList.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'EditList' + +export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/communication/index.ts b/web/app/components/base/icons/src/vender/solid/communication/index.ts index 7bb54027ae..a49c36f50e 100644 --- a/web/app/components/base/icons/src/vender/solid/communication/index.ts +++ b/web/app/components/base/icons/src/vender/solid/communication/index.ts @@ -1,5 +1,6 @@ export { default as AiText } from './AiText' export { default as CuteRobote } from './CuteRobote' +export { default as EditList } from './EditList' export { default as MessageDotsCircle } from './MessageDotsCircle' export { default as MessageFast } from './MessageFast' export { default as MessageHeartCircle } from './MessageHeartCircle' diff --git a/web/app/components/workflow/nodes/http/components/key-value/bulk-edit/index.tsx b/web/app/components/workflow/nodes/http/components/key-value/bulk-edit/index.tsx new file mode 100644 index 0000000000..ab30b54301 --- /dev/null +++ b/web/app/components/workflow/nodes/http/components/key-value/bulk-edit/index.tsx @@ -0,0 +1,66 @@ +'use client' +import type { FC } from 'react' +import React, { useCallback } from 'react' +import { useTranslation } from 'react-i18next' +import Editor from '@/app/components/workflow/nodes/_base/components/editor/base' +import { LayoutGrid02 } from '@/app/components/base/icons/src/vender/line/layout' + +const i18nPrefix = 'workflow.nodes.http' + +type Props = { + value: string + onChange: (value: string) => void + onSwitchToKeyValueEdit: () => void +} + +const BulkEdit: FC = ({ + value, + onChange, + onSwitchToKeyValueEdit, +}) => { + const { t } = useTranslation() + const [tempValue, setTempValue] = React.useState(value) + + const [isFocus, setIsFocus] = React.useState(false) + + const handleChange = useCallback((e: React.ChangeEvent) => { + setTempValue(e.target.value) + }, []) + + const handleSwitchToKeyValueEdit = useCallback(() => { + onChange(tempValue) + onSwitchToKeyValueEdit() + }, [tempValue, onChange, onSwitchToKeyValueEdit]) + + return ( +
+ {t(`${i18nPrefix}.bulkEdit`)}
} + value={value} + headerRight={ +
+
+ +
{t(`${i18nPrefix}.keyValueEdit`)}
+
+
+
+ } + isFocus={isFocus} + minHeight={150} + > +