mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-23 13:31:43 +02:00
fix: Collection variable viewer (#1947)
Due to changes in https://github.com/usebruno/bruno/pull/650 collection variables would be passed as a object but was exptected to be an array. Collection variables are now converted to an array.
This commit is contained in:
parent
179c30b15b
commit
0cce14b4d5
@ -7,8 +7,7 @@ import { findEnvironmentInCollection, maskInputValue } from 'utils/collections';
|
|||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
import { IconEye, IconEyeOff } from '@tabler/icons';
|
import { IconEye, IconEyeOff } from '@tabler/icons';
|
||||||
|
|
||||||
const KeyValueExplorer = ({ data, theme }) => {
|
const KeyValueExplorer = ({ data = [], theme }) => {
|
||||||
data = data || {};
|
|
||||||
const [showSecret, setShowSecret] = useState(false);
|
const [showSecret, setShowSecret] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -66,11 +65,17 @@ const EnvVariables = ({ collection, theme }) => {
|
|||||||
const CollectionVariables = ({ collection, theme }) => {
|
const CollectionVariables = ({ collection, theme }) => {
|
||||||
const collectionVariablesFound = Object.keys(collection.collectionVariables).length > 0;
|
const collectionVariablesFound = Object.keys(collection.collectionVariables).length > 0;
|
||||||
|
|
||||||
|
const collectionVariableArray = Object.entries(collection.collectionVariables).map(([name, value]) => ({
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
secret: false
|
||||||
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h1 className="font-semibold mb-2">Collection Variables</h1>
|
<h1 className="font-semibold mb-2">Collection Variables</h1>
|
||||||
{collectionVariablesFound ? (
|
{collectionVariablesFound ? (
|
||||||
<KeyValueExplorer data={collection.collectionVariables} theme={theme} />
|
<KeyValueExplorer data={collectionVariableArray} theme={theme} />
|
||||||
) : (
|
) : (
|
||||||
<div className="muted text-xs">No collection variables found</div>
|
<div className="muted text-xs">No collection variables found</div>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user