mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-12 10:21:30 +00:00
Fix global env issue on bulk import (#5396)
This commit is contained in:
committed by
GitHub
parent
aec9ee6265
commit
2ed51bb984
@@ -25,12 +25,7 @@ const ImportEnvironment = ({ onClose }) => {
|
||||
}
|
||||
)
|
||||
.map((environment) => {
|
||||
let variables = environment?.variables?.map(v => ({
|
||||
...v,
|
||||
uid: uuid(),
|
||||
type: 'text'
|
||||
}));
|
||||
dispatch(addGlobalEnvironment({ name: environment.name, variables }))
|
||||
dispatch(addGlobalEnvironment({ name: environment.name, variables: environment.variables }))
|
||||
.then(() => {
|
||||
toast.success('Global Environment imported successfully');
|
||||
})
|
||||
|
||||
@@ -15,6 +15,7 @@ const importPostmanEnvironmentVariables = (brunoEnvironment, values = []) => {
|
||||
name: (i.key ?? '').replace(invalidVariableCharacterRegex, '_'),
|
||||
value: i.value ?? '',
|
||||
enabled: i.enabled,
|
||||
type: 'text',
|
||||
secret: isSecret(i.type)
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ describe('postmanToBrunoEnvironment Function', () => {
|
||||
value: 'value1',
|
||||
enabled: true,
|
||||
secret: false,
|
||||
type: 'text',
|
||||
uid: "mockeduuidvalue123456",
|
||||
},
|
||||
{
|
||||
@@ -39,6 +40,7 @@ describe('postmanToBrunoEnvironment Function', () => {
|
||||
value: 'value2',
|
||||
enabled: false,
|
||||
secret: true,
|
||||
type: 'text',
|
||||
uid: "mockeduuidvalue123456",
|
||||
},
|
||||
],
|
||||
@@ -85,6 +87,7 @@ describe('postmanToBrunoEnvironment Function', () => {
|
||||
value: '',
|
||||
enabled: true,
|
||||
secret: false,
|
||||
type: 'text',
|
||||
uid: "mockeduuidvalue123456",
|
||||
},
|
||||
{
|
||||
@@ -92,6 +95,7 @@ describe('postmanToBrunoEnvironment Function', () => {
|
||||
value: '',
|
||||
enabled: true,
|
||||
secret: false,
|
||||
type: 'text',
|
||||
uid: "mockeduuidvalue123456",
|
||||
},
|
||||
{
|
||||
@@ -99,7 +103,8 @@ describe('postmanToBrunoEnvironment Function', () => {
|
||||
value: '',
|
||||
enabled: true,
|
||||
secret: false,
|
||||
uid: "mockeduuidvalue123456",
|
||||
type: 'text',
|
||||
uid: "mockeduuidvalue123456"
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user