feat: documentation link in app titlebar

This commit is contained in:
Anoop M D 2023-09-24 02:33:58 +05:30
parent 9b94cddc9b
commit c5a86cb343
4 changed files with 12 additions and 5 deletions

View File

@ -13,6 +13,7 @@
"packages/bruno-testbench",
"packages/bruno-graphql-docs"
],
"homepage": "https://usebruno.com",
"devDependencies": {
"@faker-js/faker": "^7.6.0",
"@jest/globals": "^29.2.0",

View File

@ -1,7 +1,7 @@
{
"version": "v0.14.1",
"name": "bruno",
"description": "Opensource API Client",
"description": "Opensource API Client for Exploring and Testing APIs",
"homepage": "https://www.usebruno.com",
"private": true,
"main": "src/index.js",

View File

@ -7,7 +7,7 @@ const template = [
label: 'Collection',
submenu: [
{
label: 'Open Local Collection',
label: 'Open Collection',
click() {
ipcMain.emit('main:open-collection');
}
@ -49,12 +49,13 @@ const template = [
label: 'About Bruno',
click: () =>
openAboutWindow({
icon_path: join(__dirname, '../../resources/icons/png/128x128.png'),
product_name: 'Bruno',
icon_path: join(__dirname, '../../resources/icons/png/256x256.png'),
homepage: 'https://www.usebruno.com/',
package_json_dir: join(__dirname, '../..')
})
},
{ label: 'Learn More' }
{ label: 'Documentation', click: () => ipcMain.emit('main:open-docs') }
]
}
];

View File

@ -1,7 +1,7 @@
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const { ipcMain } = require('electron');
const { ipcMain, shell } = require('electron');
const { envJsonToBru, bruToJson, jsonToBru } = require('../bru');
const {
@ -443,6 +443,11 @@ const registerMainEventHandlers = (mainWindow, watcher, lastOpenedCollections) =
}
});
ipcMain.on('main:open-docs', () => {
const docsURL = 'https://docs.usebruno.com';
shell.openExternal(docsURL);
});
ipcMain.on('main:collection-opened', (win, pathname, uid) => {
watcher.addWatcher(win, pathname, uid);
lastOpenedCollections.add(pathname);