Skip to content

Commit

Permalink
tidy up of td.vue src code format
Browse files Browse the repository at this point in the history
  • Loading branch information
jon gadsden committed Sep 25, 2022
1 parent 79fcd96 commit 92d965a
Show file tree
Hide file tree
Showing 37 changed files with 130 additions and 133 deletions.
10 changes: 5 additions & 5 deletions td.vue/src/desktop/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const isDevelopment = process.env.NODE_ENV !== 'production';

// Scheme must be registered before the app is ready
protocol.registerSchemesAsPrivileged([
{ scheme: 'app', privileges: { secure: true, standard: true } },
{ scheme: 'app', privileges: { secure: true, standard: true } }
]);

async function createWindow() {
async function createWindow () {
// Create the browser window.
const win = new BrowserWindow({
width: 1400,
Expand All @@ -30,8 +30,8 @@ async function createWindow() {
enableRemoteModule: !!process.env.IS_TEST,

nodeIntegration: false,
contextIsolation: true,
},
contextIsolation: true
}
});

// set up electron-specific logging
Expand Down Expand Up @@ -72,8 +72,8 @@ app.on('activate', () => {
app.on('ready', async () => {
Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));

// Install Vue Devtools
if (isDevelopment && !process.env.IS_TEST) {
// Install Vue Devtools
try {
await installExtension(VUEJS_DEVTOOLS);
} catch (e) {
Expand Down
20 changes: 10 additions & 10 deletions td.vue/src/desktop/desktop.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const menuTemplate = [
submenu: [
{
label: tc('desktop.file.open'),
click() {
click () {
openThreatModel();
}
},
Expand All @@ -25,19 +25,19 @@ export const menuTemplate = [
},
{
label: tc('desktop.file.save'),
click() {
click () {
saveThreatModel();
}
},
{
label: tc('desktop.file.saveAs'),
click() {
click () {
saveAsThreatModel();
}
},
{
label: tc('desktop.file.close'),
click() {
click () {
closeThreatModel();
}
},
Expand Down Expand Up @@ -95,13 +95,13 @@ export const menuTemplate = [
];

// close the model using modal dialog if changed
function closeThreatModel() {
function closeThreatModel () {
// Close threat model, if changed then show Save? modal dialog
dialog.showErrorBox( 'Not yet implemented', 'Close model file TBD' );
dialog.showErrorBox('Not yet implemented', 'Close model file TBD');
}

// Open file system dialog
function openThreatModel() {
function openThreatModel () {
dialog.showOpenDialog({
title: tc('desktop.file.open'),
properties: ['openFile'],
Expand All @@ -119,13 +119,13 @@ function openThreatModel() {
}

// save the model catching any errors
function saveThreatModel() {
function saveThreatModel () {
// if threat model exists, save to file system without dialog
dialog.showErrorBox( 'Not yet implemented', 'Save model file TBD' );
dialog.showErrorBox('Not yet implemented', 'Save model file TBD');
}

// SaveAs file system dialog
function saveAsThreatModel() {
function saveAsThreatModel () {
dialog.showSaveDialog({
title: tc('desktop.file.saveAs'),
properties: ['showHiddenFiles'],
Expand Down
14 changes: 7 additions & 7 deletions td.vue/src/i18n/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const cn = {
},
providers: {
github: {
displayName: 'GitHub',
displayName: 'GitHub'
},
local: {
displayName: '本地'
Expand All @@ -41,7 +41,7 @@ const cn = {
close: 'Close Model',
open: 'Open Model',
save: 'Save Model',
saveAs: 'Save Model As',
saveAs: 'Save Model As'
},
help: {
heading: 'Help',
Expand Down Expand Up @@ -87,19 +87,19 @@ const cn = {
addNewDiagram: '添加新图表...',
generic: {
diagramTitle: 'New generic diagram',
select: `Generic`
select: 'Generic'
},
stride: {
diagramTitle: 'New STRIDE diagram',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'New LINDDUN diagram',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'New CIA diagram',
select: `CIA`,
select: 'CIA'
}
},
threats: '威胁',
Expand Down Expand Up @@ -296,7 +296,7 @@ const cn = {
openHigh: 'Open / High Priority',
openMedium: 'Open / Medium Priority',
openLow: 'Open / Low Priority',
openUnknown: 'Open / Unknown Priority',
openUnknown: 'Open / Unknown Priority'
}
},
upgrade: {
Expand Down
14 changes: 7 additions & 7 deletions td.vue/src/i18n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const de = {
},
providers: {
github: {
displayName: 'GitHub',
displayName: 'GitHub'
},
local: {
displayName: 'Local Session'
Expand All @@ -41,7 +41,7 @@ const de = {
close: 'Close Model',
open: 'Open Model',
save: 'Save Model',
saveAs: 'Save Model As',
saveAs: 'Save Model As'
},
help: {
heading: 'Help',
Expand Down Expand Up @@ -87,19 +87,19 @@ const de = {
addNewDiagram: 'Add a new diagram...',
generic: {
diagramTitle: 'New generic diagram',
select: `Generic`
select: 'Generic'
},
stride: {
diagramTitle: 'New STRIDE diagram',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'New LINDDUN diagram',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'New CIA diagram',
select: `CIA`,
select: 'CIA'
}
},
threats: 'Threats',
Expand Down Expand Up @@ -296,7 +296,7 @@ const de = {
openHigh: 'Open / High Priority',
openMedium: 'Open / Medium Priority',
openLow: 'Open / Low Priority',
openUnknown: 'Open / Unknown Priority',
openUnknown: 'Open / Unknown Priority'
}
},
upgrade: {
Expand Down
14 changes: 7 additions & 7 deletions td.vue/src/i18n/el.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const el = {
},
providers: {
github: {
displayName: 'GitHub',
displayName: 'GitHub'
},
local: {
displayName: 'Τοπική Συνεδρία'
Expand All @@ -41,7 +41,7 @@ const el = {
close: 'Κλείσιμο Μοντέλου',
open: 'Άνοιγμα Μοντέλου',
save: 'Αποθήκευση Μοντέλου',
saveAs: 'Αποθήκευση Μοντέλου ως',
saveAs: 'Αποθήκευση Μοντέλου ως'
},
help: {
heading: 'Βοήθεια',
Expand Down Expand Up @@ -87,19 +87,19 @@ const el = {
addNewDiagram: 'Προσθέστε ένα νέο διάγραμμα...',
generic: {
diagramTitle: 'Νέο γενικό διάγραμμα',
select: `Generic`
select: 'Generic'
},
stride: {
diagramTitle: 'Νέο διάγραμμα STRIDE',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'Νέο διάγραμμα LINDDUN',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'Νέο διάγραμμα CIA',
select: `CIA`,
select: 'CIA'
}
},
threats: 'Απειλές',
Expand Down Expand Up @@ -296,7 +296,7 @@ const el = {
openHigh: 'Ανοιχτές / Υψηλής Προτεραιότητας',
openMedium: 'Ανοιχτές / Μέτριας Προτεραιότητας',
openLow: 'Ανοιχτές / Χαμηλής Προτεραιότητας',
openUnknown: 'Ανοιχτές / Άγνωστης Προτεραιότητας',
openUnknown: 'Ανοιχτές / Άγνωστης Προτεραιότητας'
}
},
upgrade: {
Expand Down
14 changes: 7 additions & 7 deletions td.vue/src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const en = {
},
providers: {
github: {
displayName: 'GitHub',
displayName: 'GitHub'
},
local: {
displayName: 'Local Session'
Expand All @@ -41,7 +41,7 @@ const en = {
close: 'Close Model',
open: 'Open Model',
save: 'Save Model',
saveAs: 'Save Model As',
saveAs: 'Save Model As'
},
help: {
heading: 'Help',
Expand Down Expand Up @@ -87,19 +87,19 @@ const en = {
addNewDiagram: 'Add a new diagram...',
generic: {
diagramTitle: 'New generic diagram',
select: `Generic`
select: 'Generic'
},
stride: {
diagramTitle: 'New STRIDE diagram',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'New LINDDUN diagram',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'New CIA diagram',
select: `CIA`,
select: 'CIA'
}
},
threats: 'Threats',
Expand Down Expand Up @@ -296,7 +296,7 @@ const en = {
openHigh: 'Open / High Priority',
openMedium: 'Open / Medium Priority',
openLow: 'Open / Low Priority',
openUnknown: 'Open / Unknown Priority',
openUnknown: 'Open / Unknown Priority'
}
},
upgrade: {
Expand Down
12 changes: 6 additions & 6 deletions td.vue/src/i18n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const es = {
close: 'Close Model',
open: 'Open Model',
save: 'Save Model',
saveAs: 'Save Model As',
saveAs: 'Save Model As'
},
help: {
heading: 'Help',
Expand Down Expand Up @@ -87,19 +87,19 @@ const es = {
addNewDiagram: 'Agregar un nuevo diagrama...',
generic: {
diagramTitle: 'New generic diagram',
select: `Generic`
select: 'Generic'
},
stride: {
diagramTitle: 'New STRIDE diagram',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'New LINDDUN diagram',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'New CIA diagram',
select: `CIA`,
select: 'CIA'
}
},
threats: 'Threats',
Expand Down Expand Up @@ -296,7 +296,7 @@ const es = {
openHigh: 'Open / High Priority',
openMedium: 'Open / Medium Priority',
openLow: 'Open / Low Priority',
openUnknown: 'Open / Unknown Priority',
openUnknown: 'Open / Unknown Priority'
}
},
upgrade: {
Expand Down
18 changes: 9 additions & 9 deletions td.vue/src/i18n/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const fr = {
},
providers: {
github: {
displayName: 'GitHub',
displayName: 'GitHub'
},
local: {
displayName: 'Session Locale'
Expand All @@ -41,7 +41,7 @@ const fr = {
close: 'Fermer Projet',
open: 'Ouvrir',
save: 'Sauvegarder',
saveAs: 'Save As',
saveAs: 'Save As'
},
help: {
heading: 'Help',
Expand Down Expand Up @@ -87,19 +87,19 @@ const fr = {
addNewDiagram: 'Ajouter un nouveau diagramme...',
generic: {
diagramTitle: 'Nouveau diagramme générique',
select: `Générique`
},
stride: {
select: 'Générique'
},
stride: {
diagramTitle: 'Nouveau diagramme STRIDE',
select: `STRIDE`
select: 'STRIDE'
},
linddun: {
diagramTitle: 'Nouveau diagramme LINDDUN',
select: `LINDDUN`
select: 'LINDDUN'
},
cia: {
diagramTitle: 'Nouveau diagramme CIA',
select: `CIA`,
select: 'CIA'
}
},
threats: 'Menaces',
Expand Down Expand Up @@ -296,7 +296,7 @@ const fr = {
openHigh: 'Open / High Priority',
openMedium: 'Open / Medium Priority',
openLow: 'Open / Low Priority',
openUnknown: 'Open / Unknown Priority',
openUnknown: 'Open / Unknown Priority'
}
},
upgrade: {
Expand Down
Loading

0 comments on commit 92d965a

Please sign in to comment.