From 4f96701a3424b531e72ab1acfdc55d4439984244 Mon Sep 17 00:00:00 2001 From: isntlazy Date: Thu, 7 Dec 2023 16:43:39 +0200 Subject: [PATCH 01/41] added temporary mock for rest api, created required services including abstract StorageService and refactoring App.vue to use them --- db-rest-mock.json | 43 ++++ package.json | 1 + src/App.vue | 35 +-- src/main.js | 9 + src/services/electronService.js | 13 ++ .../storage-options/localJsonDbService.js | 14 ++ .../storage-options/restApiService.js | 14 ++ src/services/storageInterface.js | 10 + src/services/storageService.js | 18 ++ src/store/index.js | 10 +- yarn.lock | 216 ++++++++++++++++-- 11 files changed, 340 insertions(+), 43 deletions(-) create mode 100644 db-rest-mock.json create mode 100644 src/services/electronService.js create mode 100644 src/services/storage-options/localJsonDbService.js create mode 100644 src/services/storage-options/restApiService.js create mode 100644 src/services/storageInterface.js create mode 100644 src/services/storageService.js diff --git a/db-rest-mock.json b/db-rest-mock.json new file mode 100644 index 00000000..ff303aa5 --- /dev/null +++ b/db-rest-mock.json @@ -0,0 +1,43 @@ +{ + "state": { + "title": "", + "charter": { + "content": "", + "text": "" + }, + "preconditions": { + "content": "", + "text": "" + }, + "duration": 0, + "status": "start", + "timer": 2998, + "started": "16:12 | 12-06-2023", + "ended": "", + "quickTest": true, + "path": "/", + "mindmap": { + "nodes": [ + { + "id": "5e274797-4db7-4fe8-a983-8b8abf8771c5", + "text": "System Under Test", + "url": "https://features.yattie.ai", + "fx": -210.9125181819311, + "fy": -583.1010883631283 + }, + { + "id": "4763495c-62b7-4625-9083-2d40045b6550", + "text": "Feature #1", + "fx": 99.1983655368465, + "fy": -582.6407249084972 + } + ], + "connections": [ + { + "source": "5e274797-4db7-4fe8-a983-8b8abf8771c5", + "target": "4763495c-62b7-4625-9083-2d40045b6550" + } + ] + } + } +} diff --git a/package.json b/package.json index ab4e600b..a2595929 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "ffprobe-static": "^3.1.0", "fluent-ffmpeg": "^2.1.2", "form-data": "^4.0.0", + "json-server": "^0.17.4", "lodash": "^4.17.21", "node-polyfill-webpack-plugin": "^2.0.1", "simple-json-db": "^2.0.0", diff --git a/src/App.vue b/src/App.vue index 128efa9f..0346450e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,8 +7,6 @@ diff --git a/src/components/dialogs/EditEvidenceDialog.vue b/src/components/dialogs/EditEvidenceDialog.vue new file mode 100644 index 00000000..a286e344 --- /dev/null +++ b/src/components/dialogs/EditEvidenceDialog.vue @@ -0,0 +1,694 @@ + + + + From 177494eda2d8299db3186ed1624ba6f45a66c93f Mon Sep 17 00:00:00 2001 From: isntlazy Date: Fri, 12 Jan 2024 11:43:31 +0200 Subject: [PATCH 37/41] both AddEvidence and EditEvidence are showing --- src/components/TimelineWrapper.vue | 4 ++++ src/components/dialogs/AddEvidenceDialog.vue | 12 +++++++----- src/components/dialogs/EditEvidenceDialog.vue | 11 +++-------- src/modules/CaptureUtility.js | 1 + src/views/MainView.vue | 1 + 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/TimelineWrapper.vue b/src/components/TimelineWrapper.vue index 77c6fdfb..7d1f5fba 100644 --- a/src/components/TimelineWrapper.vue +++ b/src/components/TimelineWrapper.vue @@ -1103,6 +1103,7 @@ export default { if (this.clicks === 1) { setTimeout( function () { + console.log("trigger from here"); switch (this.clicks) { case 1: if (this.eventName === "click") { @@ -1132,7 +1133,10 @@ export default { }, async handleActiveSession(id) { this.itemToEdit = await this.$storageService.getItemById(id); + console.log(this.itemToEdit); + this.editEvidenceDialog = true; + // this.activeSession = await this.$storageService.getItemById(id); // this.$emit("submit-session", this.activeSession); }, diff --git a/src/components/dialogs/AddEvidenceDialog.vue b/src/components/dialogs/AddEvidenceDialog.vue index e6dcc5c5..d3cf0e75 100644 --- a/src/components/dialogs/AddEvidenceDialog.vue +++ b/src/components/dialogs/AddEvidenceDialog.vue @@ -449,6 +449,11 @@ export default { this.$root.$on("save-data", this.saveData); }, watch: { + itemData: function (val) { + console.log("itemData changed"); + console.log(val); + this.activeSession(); + }, createJiraTicket: async function (val) { if (val) { let response = await jiraIntegrationHelper.getAllProjects( @@ -541,8 +546,9 @@ export default { if (this.$isElectron) { await this.$electronService.deleteFile(this.item.filePath); await this.$electronService.deleteFile(this.item.poster); - await this.$electronService.closeAddWindow(); + // await this.$electronService.closeAddWindow(); } + this.$emit("close"); }, async handleSave() { if (this.createJiraTicket) { @@ -587,10 +593,6 @@ export default { this.items.push(newItem); await this.$storageService.updateItems(this.items); - // if (this.$isElectron) { - // await this.$electronService.closeAddWindow(); - // } - console.log("Inside Save Data"); this.$emit("close"); }, handleClear() { diff --git a/src/components/dialogs/EditEvidenceDialog.vue b/src/components/dialogs/EditEvidenceDialog.vue index a286e344..e46040a9 100644 --- a/src/components/dialogs/EditEvidenceDialog.vue +++ b/src/components/dialogs/EditEvidenceDialog.vue @@ -1,5 +1,6 @@ From 15a2c888b2aa452d77822bbb3ac3517eb5dacd55 Mon Sep 17 00:00:00 2001 From: isntlazy Date: Fri, 12 Jan 2024 19:30:52 +0200 Subject: [PATCH 40/41] abstracting business logic --- src/components/ControlPanel.vue | 11 ++--------- src/services/storage-options/localJsonDbService.js | 6 ++++++ src/services/storageService.js | 4 ++++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 5c53cd0c..cd70c755 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -721,8 +721,6 @@ import JiraAddIssue from "./jira/JiraAddIssue"; import { DEFAULT_MAP_CONNECTIONS, DEFAULT_MAP_NODES, - IPC_FUNCTIONS, - IPC_HANDLERS, SESSION_STATUSES, STATUSES, VIDEO_RESOLUTION, @@ -1119,9 +1117,7 @@ export default { this.changeSessionStatus(SESSION_STATUSES.START); } - const sessionId = await window.ipc.invoke(IPC_HANDLERS.DATABASE, { - func: IPC_FUNCTIONS.GET_SESSION_ID, - }); + const sessionId = await this.$storageService.getSessionId(); if (sessionId === "") { const data = { @@ -1137,10 +1133,7 @@ export default { path: this.$route.path, }; - window.ipc.invoke(IPC_HANDLERS.FILE_SYSTEM, { - func: IPC_FUNCTIONS.CREATE_NEW_SESSION, - data: data, - }); + await this.$storageService.createNewSession(data); } if (this.viewMode === "normal") { diff --git a/src/services/storage-options/localJsonDbService.js b/src/services/storage-options/localJsonDbService.js index 4b48b307..c146b54d 100644 --- a/src/services/storage-options/localJsonDbService.js +++ b/src/services/storage-options/localJsonDbService.js @@ -94,6 +94,12 @@ export default class LocalJsonDbService extends StorageInterface { }); } + async getSessionId() { + return await window.ipc.invoke(IPC_HANDLERS.DATABASE, { + func: IPC_FUNCTIONS.GET_SESSION_ID, + }); + } + async saveSession(data) { return await window.ipc.invoke(IPC_HANDLERS.FILE_SYSTEM, { func: IPC_FUNCTIONS.SAVE_SESSION, diff --git a/src/services/storageService.js b/src/services/storageService.js index c59e05e3..138df02b 100644 --- a/src/services/storageService.js +++ b/src/services/storageService.js @@ -64,6 +64,10 @@ export default class StorageService { return this.storage.createNewSession(data); } + async getSessionId() { + return this.storage.getSessionId(); + } + async saveSession(data) { return await this.storage.saveSession(data); } From 036818fc2ac0a3789c21f0a420306b7fa8def0d2 Mon Sep 17 00:00:00 2001 From: isntlazy Date: Tue, 16 Jan 2024 16:19:01 +0200 Subject: [PATCH 41/41] shareOauthDialog replacement with vuetify --- src/components/dialogs/ShareOAuthDialog.vue | 122 ++++++++++++++++++++ src/components/settings/GeneralTab.vue | 29 +++-- 2 files changed, 144 insertions(+), 7 deletions(-) create mode 100644 src/components/dialogs/ShareOAuthDialog.vue diff --git a/src/components/dialogs/ShareOAuthDialog.vue b/src/components/dialogs/ShareOAuthDialog.vue new file mode 100644 index 00000000..0dd7dbe7 --- /dev/null +++ b/src/components/dialogs/ShareOAuthDialog.vue @@ -0,0 +1,122 @@ + + + + diff --git a/src/components/settings/GeneralTab.vue b/src/components/settings/GeneralTab.vue index 0cd8d99e..90cd3a65 100644 --- a/src/components/settings/GeneralTab.vue +++ b/src/components/settings/GeneralTab.vue @@ -34,7 +34,7 @@ {{ meta.credentialsPath }} -

+

{{ $tc("caption.split_credentials", 1) }} +