usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
26.97k stars 1.23k forks source link

Importing collections : last destination folder improvement when importing several collections in a row #222

Open l0new4nder3r opened 1 year ago

l0new4nder3r commented 1 year ago

When importing postman collections, one by one, first you need to select a collection to import from somewhere (let's call it A), and then you need to chose where to import it (and where to keep the Bruno collection), possibly elsewhere (B).

The interface remembers where the last opened filesystem destination was (nice!) but when importing several collections in a row, it always opens back on B when you need to select collections from A, and A when you want to select the Bruno collections destination (B), and this can be annoying and tedious.

If it is possible, it would be nicer to keep track of the last A location (import folder) AND separately, the last B location (destination folder).

helloanoop commented 1 year ago

Electron provides an option to do this.

Need to cache the lastImportPath and reuse it

const { dialog } = require('electron');

dialog.showOpenDialog({
  defaultPath: lastImportPath
}, (filePaths) => {
    lastImportPath = filePaths[0];
  }
});

Will have this done for our next release.

mirkogolze commented 1 year ago

The contentSecurityPolicy is not working.

While starting Bruno I get the following warning.

(node:6928) UnhandledPromiseRejectionWarning: Error: Each line must end in a semicolon
    at exports.setContentSecurityPolicy (C:\Users\migo\AppData\Local\Programs\bruno\resources\app.asar\node_modules\electron-util\index.js:150:9)
(Use `Bruno --trace-warnings ...` to show where the warning was created)
(node:6928) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

when I add the missing semicolon

setContentSecurityPolicy(contentSecurityPolicy.join(';') + ';');

in DevMode (isDev) only the design is killed. In !devMmode (!isDev) nothing happens on the main window