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:
Abhishek S Lal
2026-03-27 20:15:34 +05:30
committed by GitHub
parent 2977fc7bea
commit f491e9091b
5 changed files with 20 additions and 9 deletions

View File

@@ -24,7 +24,6 @@ const Wrapper = styled.div`
}
.file-value-cell {
padding: 4px 0;
.file-name {
font-size: 12px;

View File

@@ -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>
);
}

View File

@@ -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)}

View File

@@ -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) {}
}

View File

@@ -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) {}
}