mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-24 11:55:50 +01:00
lint fixes
This commit is contained in:
parent
b41a38afbb
commit
5c190606bf
@ -16,6 +16,7 @@ import {
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { ModalComponent } from './modal.component';
|
import { ModalComponent } from './modal.component';
|
||||||
|
|
||||||
import { SettingsComponent } from './accounts/settings.component';
|
import { SettingsComponent } from './accounts/settings.component';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
@ -11,6 +11,7 @@ const watch = args.some((val) => val === '--watch');
|
|||||||
const dev = args.some((val) => val === '--dev');
|
const dev = args.some((val) => val === '--dev');
|
||||||
|
|
||||||
if (watch) {
|
if (watch) {
|
||||||
|
// tslint:disable-next-line
|
||||||
require('electron-reload')(__dirname, {});
|
require('electron-reload')(__dirname, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,5 +26,6 @@ windowMain.init().then(() => {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
menuMain.init();
|
menuMain.init();
|
||||||
}, (e: any) => {
|
}, (e: any) => {
|
||||||
|
// tslint:disable-next-line
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
});
|
||||||
|
@ -2,9 +2,9 @@ import {
|
|||||||
app,
|
app,
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
dialog,
|
dialog,
|
||||||
|
ipcMain,
|
||||||
Menu,
|
Menu,
|
||||||
MenuItemConstructorOptions,
|
MenuItemConstructorOptions,
|
||||||
ipcMain,
|
|
||||||
shell,
|
shell,
|
||||||
} from 'electron';
|
} from 'electron';
|
||||||
|
|
||||||
@ -24,72 +24,72 @@ export class MenuMain {
|
|||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('addNewLogin'),
|
label: this.i18nService.t('addNewLogin'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newLogin');
|
self.send('newLogin');
|
||||||
},
|
},
|
||||||
accelerator: 'CmdOrCtrl+N'
|
accelerator: 'CmdOrCtrl+N',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('addNewItem'),
|
label: this.i18nService.t('addNewItem'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('typeLogin'),
|
label: this.i18nService.t('typeLogin'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newLogin');
|
self.send('newLogin');
|
||||||
},
|
},
|
||||||
accelerator: 'Alt+L'
|
accelerator: 'Alt+L',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('typeCard'),
|
label: this.i18nService.t('typeCard'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newCard');
|
self.send('newCard');
|
||||||
},
|
},
|
||||||
accelerator: 'Alt+C'
|
accelerator: 'Alt+C',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('typeIdentity'),
|
label: this.i18nService.t('typeIdentity'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newIdentity');
|
self.send('newIdentity');
|
||||||
},
|
},
|
||||||
accelerator: 'Alt+I'
|
accelerator: 'Alt+I',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('typeSecureNote'),
|
label: this.i18nService.t('typeSecureNote'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newSecureNote');
|
self.send('newSecureNote');
|
||||||
},
|
},
|
||||||
accelerator: 'Alt+S'
|
accelerator: 'Alt+S',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('addNewFolder'),
|
label: this.i18nService.t('addNewFolder'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('newFolder');
|
self.send('newFolder');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('settings'),
|
label: this.i18nService.t('settings'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('openSettings');
|
self.send('openSettings');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('syncVault'),
|
label: this.i18nService.t('syncVault'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('syncVault');
|
self.send('syncVault');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('lockNow'),
|
label: this.i18nService.t('lockNow'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('lockVault');
|
self.send('lockVault');
|
||||||
},
|
},
|
||||||
accelerator: 'CmdOrCtrl+L'
|
accelerator: 'CmdOrCtrl+L',
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('edit'),
|
label: this.i18nService.t('edit'),
|
||||||
@ -101,24 +101,24 @@ export class MenuMain {
|
|||||||
{ role: 'cut' },
|
{ role: 'cut' },
|
||||||
{ role: 'copy' },
|
{ role: 'copy' },
|
||||||
{ role: 'paste' },
|
{ role: 'paste' },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('view'),
|
label: this.i18nService.t('view'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('passwordGenerator'),
|
label: this.i18nService.t('passwordGenerator'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('openPasswordGenerator');
|
self.send('openPasswordGenerator');
|
||||||
},
|
},
|
||||||
accelerator: 'CmdOrCtrl+G'
|
accelerator: 'CmdOrCtrl+G',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('searchVault'),
|
label: this.i18nService.t('searchVault'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('focusSearch');
|
self.send('focusSearch');
|
||||||
},
|
},
|
||||||
accelerator: 'CmdOrCtrl+F'
|
accelerator: 'CmdOrCtrl+F',
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ role: 'zoomin', accelerator: 'CmdOrCtrl+=' },
|
{ role: 'zoomin', accelerator: 'CmdOrCtrl+=' },
|
||||||
@ -130,20 +130,20 @@ export class MenuMain {
|
|||||||
{ role: 'reload', accelerator: 'Alt+Shift+R' },
|
{ role: 'reload', accelerator: 'Alt+Shift+R' },
|
||||||
{ role: 'forcereload' },
|
{ role: 'forcereload' },
|
||||||
{ role: 'toggledevtools' },
|
{ role: 'toggledevtools' },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('account'),
|
label: this.i18nService.t('account'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('premiumMembership'),
|
label: this.i18nService.t('premiumMembership'),
|
||||||
click() {
|
click: () => {
|
||||||
self.send('premiumMembership');
|
self.send('premiumMembership');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('changeMasterPass'),
|
label: this.i18nService.t('changeMasterPass'),
|
||||||
click() {
|
click: () => {
|
||||||
const result = dialog.showMessageBox(self.windowMain.win, {
|
const result = dialog.showMessageBox(self.windowMain.win, {
|
||||||
title: self.i18nService.t('changeMasterPass'),
|
title: self.i18nService.t('changeMasterPass'),
|
||||||
message: self.i18nService.t('changeMasterPasswordConfirmation'),
|
message: self.i18nService.t('changeMasterPasswordConfirmation'),
|
||||||
@ -155,11 +155,11 @@ export class MenuMain {
|
|||||||
if (result === 0) {
|
if (result === 0) {
|
||||||
shell.openExternal('https://vault.bitwarden.com');
|
shell.openExternal('https://vault.bitwarden.com');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('changeEmail'),
|
label: this.i18nService.t('changeEmail'),
|
||||||
click() {
|
click: () => {
|
||||||
const result = dialog.showMessageBox(self.windowMain.win, {
|
const result = dialog.showMessageBox(self.windowMain.win, {
|
||||||
title: self.i18nService.t('changeEmail'),
|
title: self.i18nService.t('changeEmail'),
|
||||||
message: self.i18nService.t('changeEmailConfirmation'),
|
message: self.i18nService.t('changeEmailConfirmation'),
|
||||||
@ -171,12 +171,12 @@ export class MenuMain {
|
|||||||
if (result === 0) {
|
if (result === 0) {
|
||||||
shell.openExternal('https://vault.bitwarden.com');
|
shell.openExternal('https://vault.bitwarden.com');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('logOut'),
|
label: this.i18nService.t('logOut'),
|
||||||
click() {
|
click: () => {
|
||||||
const result = dialog.showMessageBox(self.windowMain.win, {
|
const result = dialog.showMessageBox(self.windowMain.win, {
|
||||||
title: self.i18nService.t('logOut'),
|
title: self.i18nService.t('logOut'),
|
||||||
message: self.i18nService.t('logOutConfirmation'),
|
message: self.i18nService.t('logOutConfirmation'),
|
||||||
@ -188,38 +188,37 @@ export class MenuMain {
|
|||||||
if (result === 0) {
|
if (result === 0) {
|
||||||
self.send('logout');
|
self.send('logout');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: 'window',
|
role: 'window',
|
||||||
submenu: [
|
submenu: [
|
||||||
{ role: 'minimize' },
|
{ role: 'minimize' },
|
||||||
{ role: 'close' }
|
{ role: 'close' },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: 'help',
|
role: 'help',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('emailUs'),
|
label: this.i18nService.t('emailUs'),
|
||||||
click() {
|
click: () => {
|
||||||
;
|
|
||||||
shell.openExternal('mailTo:hello@bitwarden.com');
|
shell.openExternal('mailTo:hello@bitwarden.com');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('visitOurWebsite'),
|
label: this.i18nService.t('visitOurWebsite'),
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://bitwarden.com/contact');
|
shell.openExternal('https://bitwarden.com/contact');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('fileBugReport'),
|
label: this.i18nService.t('fileBugReport'),
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://github.com/bitwarden/desktop');
|
shell.openExternal('https://github.com/bitwarden/desktop');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
@ -227,104 +226,104 @@ export class MenuMain {
|
|||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('blog'),
|
label: this.i18nService.t('blog'),
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://blog.bitwarden.com');
|
shell.openExternal('https://blog.bitwarden.com');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Twitter',
|
label: 'Twitter',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://twitter.com/bitwarden_app');
|
shell.openExternal('https://twitter.com/bitwarden_app');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Facebook',
|
label: 'Facebook',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://www.facebook.com/bitwarden/');
|
shell.openExternal('https://www.facebook.com/bitwarden/');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Google+',
|
label: 'Google+',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://plus.google.com/114869903467947368993');
|
shell.openExternal('https://plus.google.com/114869903467947368993');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'GitHub',
|
label: 'GitHub',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://github.com/bitwarden');
|
shell.openExternal('https://github.com/bitwarden');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('goToWebVault'),
|
label: this.i18nService.t('goToWebVault'),
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://vault.bitwarden.com');
|
shell.openExternal('https://vault.bitwarden.com');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('getMobileApp'),
|
label: this.i18nService.t('getMobileApp'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'iOS',
|
label: 'iOS',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://itunes.apple.com/app/' +
|
shell.openExternal('https://itunes.apple.com/app/' +
|
||||||
'bitwarden-free-password-manager/id1137397744?mt=8');
|
'bitwarden-free-password-manager/id1137397744?mt=8');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Android',
|
label: 'Android',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://play.google.com/store/apps/' +
|
shell.openExternal('https://play.google.com/store/apps/' +
|
||||||
'details?id=com.x8bit.bitwarden');
|
'details?id=com.x8bit.bitwarden');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18nService.t('getBrowserExtension'),
|
label: this.i18nService.t('getBrowserExtension'),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Chrome',
|
label: 'Chrome',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://chrome.google.com/webstore/detail/' +
|
shell.openExternal('https://chrome.google.com/webstore/detail/' +
|
||||||
+'bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb');
|
+'bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Firefox',
|
label: 'Firefox',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://addons.mozilla.org/firefox/addon/' +
|
shell.openExternal('https://addons.mozilla.org/firefox/addon/' +
|
||||||
'bitwarden-password-manager/');
|
'bitwarden-password-manager/');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Opera',
|
label: 'Opera',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://addons.opera.com/extensions/details/' +
|
shell.openExternal('https://addons.opera.com/extensions/details/' +
|
||||||
'bitwarden-free-password-manager/');
|
'bitwarden-free-password-manager/');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Edge',
|
label: 'Edge',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://www.microsoft.com/store/p/' +
|
shell.openExternal('https://www.microsoft.com/store/p/' +
|
||||||
'bitwarden-free-password-manager/9p6kxl0svnnl');
|
'bitwarden-free-password-manager/9p6kxl0svnnl');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Safari',
|
label: 'Safari',
|
||||||
click() {
|
click: () => {
|
||||||
shell.openExternal('https://safari-extensions.apple.com/details/' +
|
shell.openExternal('https://safari-extensions.apple.com/details/' +
|
||||||
'?id=com.bitwarden.safari-LTZ2PFU5D6');
|
'?id=com.bitwarden.safari-LTZ2PFU5D6');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
@ -339,7 +338,7 @@ export class MenuMain {
|
|||||||
{ role: 'hideothers' },
|
{ role: 'hideothers' },
|
||||||
{ role: 'unhide' },
|
{ role: 'unhide' },
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ role: 'quit' }
|
{ role: 'quit' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Window menu
|
// Window menu
|
||||||
@ -348,8 +347,8 @@ export class MenuMain {
|
|||||||
{ role: 'minimize' },
|
{ role: 'minimize' },
|
||||||
{ role: 'zoom' },
|
{ role: 'zoom' },
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ role: 'front' }
|
{ role: 'front' },
|
||||||
]
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate(template);
|
const menu = Menu.buildFromTemplate(template);
|
||||||
|
Loading…
Reference in New Issue
Block a user