mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-27 06:34:06 +00:00
refactor: update file name display in MultipartFormParams and ResponseExampleMultipartFormParams components (#7595)
- Replaced the static file name display with a SingleLineEditor for better readability and consistency. - Removed unnecessary padding in StyledWrapper for a cleaner layout. - Enhanced value interpolation logic to handle arrays in interpolate-vars.js for improved data processing.
This commit is contained in:
@@ -24,7 +24,6 @@ const Wrapper = styled.div`
|
||||
}
|
||||
|
||||
.file-value-cell {
|
||||
padding: 4px 0;
|
||||
|
||||
.file-name {
|
||||
font-size: 12px;
|
||||
|
||||
@@ -147,9 +147,15 @@ const MultipartFormParams = ({ item, collection }) => {
|
||||
<IconX size={16} />
|
||||
</button>
|
||||
<IconFile size={16} className="text-muted mr-1" />
|
||||
<span className="file-name flex-1 truncate" title={Array.isArray(value) ? value.join(', ') : value}>
|
||||
{fileName}
|
||||
</span>
|
||||
<div className="file-name flex-1 truncate" title={Array.isArray(value) ? value.join(', ') : value}>
|
||||
<SingleLineEditor
|
||||
theme={storedTheme}
|
||||
value={fileName}
|
||||
readOnly={true}
|
||||
collection={collection}
|
||||
item={item}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -188,9 +188,15 @@ const ResponseExampleMultipartFormParams = ({ item, collection, exampleUid, edit
|
||||
return (
|
||||
<div className="flex items-center file-value-cell">
|
||||
<IconFile size={16} className="text-muted mr-1" />
|
||||
<span className="file-name flex-1 truncate" title={Array.isArray(value) ? value.join(', ') : value}>
|
||||
{fileName}
|
||||
</span>
|
||||
<div className="file-name flex-1 truncate" title={Array.isArray(value) ? value.join(', ') : value}>
|
||||
<SingleLineEditor
|
||||
theme={storedTheme}
|
||||
value={fileName}
|
||||
readOnly={true}
|
||||
collection={collection}
|
||||
item={item}
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
className="clear-file-btn ml-1"
|
||||
onClick={() => handleClearFile(row)}
|
||||
|
||||
@@ -101,7 +101,7 @@ const interpolateVars = (request, envVariables = {}, runtimeVariables = {}, proc
|
||||
try {
|
||||
request.data = request?.data?.map((d) => ({
|
||||
...d,
|
||||
value: _interpolate(d?.value)
|
||||
value: Array.isArray(d?.value) ? d.value.map((v) => _interpolate(v)) : _interpolate(d?.value)
|
||||
}));
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ const interpolateVars = (request, envVariables = {}, runtimeVariables = {}, proc
|
||||
try {
|
||||
request.data = request?.data?.map((d) => ({
|
||||
...d,
|
||||
value: _interpolate(d?.value)
|
||||
value: Array.isArray(d?.value) ? d.value.map((v) => _interpolate(v)) : _interpolate(d?.value)
|
||||
}));
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user