Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused views/components #169

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 10 additions & 40 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1153,13 +1153,7 @@ export default {
this.loaded = true;
this.sources = data;

if (this.viewMode === "normal") {
this.sourcePickerDialog = true;
} else {
if (this.$isElectron) {
await this.$electronService.openSourcePickerWindow(this.sources);
}
}
this.sourcePickerDialog = true;
} catch (err) {
console.log(err);
}
Expand Down Expand Up @@ -1196,16 +1190,10 @@ export default {
this.shareSessionDialog = false;
},
showNoteDialog() {
if (this.viewMode === "normal") {
this.noteDialog = true;
setTimeout(() => {
this.$refs.noteDialog.$refs.comment.editor.commands.focus();
});
} else {
if (this.$isElectron) {
this.$electronService.openNoteEditorWindow(this.config);
}
}
this.noteDialog = true;
setTimeout(() => {
this.$refs.noteDialog.$refs.comment.editor.commands.focus();
});
},
hideNoteDialog() {
this.noteDialog = false;
Expand Down Expand Up @@ -1347,26 +1335,14 @@ export default {
await this.$router.push({ path: "/result" });
},
showSummaryDialog() {
if (this.viewMode === "normal") {
this.summaryDialog = true;
this.summaryDialog = true;

setTimeout(() => {
this.$refs.summaryDialog.$refs.comment.editor.commands.focus();
}, 200);
} else {
if (this.$isElectron) {
this.$electronService.openSummaryWindow(this.config);
}
}
setTimeout(() => {
this.$refs.summaryDialog.$refs.comment.editor.commands.focus();
}, 200);
},
showEndSessionDialog() {
if (this.viewMode === "normal") {
this.endSessionDialog = true;
} else {
if (this.$isElectron) {
this.$electronService.openEndSessionWindow(this.config);
}
}
this.endSessionDialog = true;
},
closeEndSessionDialog(status) {
this.endSessionDialog = false;
Expand Down Expand Up @@ -1765,11 +1741,6 @@ export default {
console.log(error);
}
},
async openAddWindow(data) {
if (this.$isElectron) {
await this.$electronService.openAddWindow(data);
}
},
async addNote(data) {
const stepID = uuidv4();
let newItem = {
Expand Down Expand Up @@ -1827,7 +1798,6 @@ export default {
},
timer_mark: this.timer,
};
// this.openAddWindow(data);
this.evidenceData = data;
this.addEvidenceDialog = true;
},
Expand Down
18 changes: 16 additions & 2 deletions src/components/NotesWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@
</draggable>
</div>
</div>
<EditEvidenceDialog
v-if="itemToEdit"
v-model="editEvidenceDialog"
:item-data="itemToEdit"
@close="
editEvidenceDialog = false;
itemToEdit = null;
"
/>
</v-container>
</template>

Expand All @@ -571,12 +580,14 @@ import { VEmojiPicker } from "v-emoji-picker";

import { debounce } from "lodash";
import { FILE_TYPES, TEXT_TYPES } from "../modules/constants";
import EditEvidenceDialog from "@/components/dialogs/EditEvidenceDialog.vue";

export default {
name: "NotesWrapper",
components: {
draggable,
VEmojiPicker,
EditEvidenceDialog,
},
props: {
items: {
Expand Down Expand Up @@ -622,6 +633,8 @@ export default {
emojiMenu: {},
selectedId: null,
textTypes: TEXT_TYPES,
editEvidenceDialog: false,
itemToEdit: null,
};
},
created() {
Expand Down Expand Up @@ -713,9 +726,10 @@ export default {
);
}
},

async handleActivateEditSession(id) {
const data = await this.$storageService.getItemById(id);
this.$emit("activate-edit-session", data);
this.itemToEdit = await this.$storageService.getItemById(id);
this.editEvidenceDialog = true;
},
handleSelectedItem(id) {
this.selectedId = id;
Expand Down
10 changes: 3 additions & 7 deletions src/components/TimelineWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,7 @@ export default {
}
}
},
async openEditorModal(data) {
if (this.$isElectron) {
// todo replace with vuetify dialog
await this.$electronService.openAddWindow(data);
}
},

checkedItem(id) {
return this.selected.includes(id);
},
Expand Down Expand Up @@ -1152,7 +1147,8 @@ export default {
...item,
timer_mark: this.$store.state.session.timer,
};
await this.openEditorModal(data);
this.evidenceData = data;
this.addEvidenceDialog = true;
}
this.isDragging = false;
}
Expand Down
8 changes: 0 additions & 8 deletions src/components/WorkspaceWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
:items="itemLists"
:selectedItems="selected"
:event-type="eventName"
@activate-edit-session="activateEditSession"
/>
</v-tab-item>
<v-tab-item value="notes" :transition="false">
<NotesWrapper
:items="itemLists"
:selectedItems="selected"
:event-type="eventName"
@activate-edit-session="activateEditSession"
/>
</v-tab-item>
</v-tabs-items>
Expand Down Expand Up @@ -86,12 +84,6 @@ export default {
currentTab: "timeline",
};
},
methods: {
activateEditSession(data) {
// TODO - Use injection here to avoid this chain of emits
this.$emit("activate-edit-session", data);
},
},
};
</script>
<style scoped>
Expand Down
1 change: 0 additions & 1 deletion src/components/dialogs/AddEvidenceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@ export default {
this.emojis = this.emojis.filter((item) => item.data !== emoji.data);
},
async saveData() {
console.log("save data from AddEvidence");
const newItem = {
...this.item,
comment: this.comment,
Expand Down
12 changes: 0 additions & 12 deletions src/modules/IpcHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ ipcMain.handle(IPC_HANDLERS.WINDOW, async (event, args) => {
switch (args.func) {
case IPC_FUNCTIONS.SET_DEV_MODE:
return windowUtility.setDevMode(args.data);
case IPC_FUNCTIONS.OPEN_ADD_WINDOW:
return windowUtility.openAddWindow(args.data);
case IPC_FUNCTIONS.CLOSE_ADD_WINDOW:
return windowUtility.closeAddWindow(args.data);
case IPC_FUNCTIONS.OPEN_EDIT_WINDOW:
return windowUtility.openEditWindow(args.data);
case IPC_FUNCTIONS.CLOSE_EDIT_WINDOW:
return windowUtility.closeEditWindow(args.data);
case IPC_FUNCTIONS.OPEN_SETTING_WINDOW:
return windowUtility.openSettingWindow(args.data);
case IPC_FUNCTIONS.CLOSE_SETTING_WINDOW:
Expand All @@ -74,10 +66,6 @@ ipcMain.handle(IPC_HANDLERS.WINDOW, async (event, args) => {
return windowUtility.openModalWindow(args.data);
case IPC_FUNCTIONS.CLOSE_MODAL_WINDOW:
return windowUtility.closeModalWindow(args.data);
case IPC_FUNCTIONS.OPEN_NOTES_WINDOW:
return windowUtility.openNotesWindow(args.data);
case IPC_FUNCTIONS.CLOSE_NOTES_WINDOW:
return windowUtility.closeNotesWindow();
case IPC_FUNCTIONS.MOVE_WINDOW:
return windowUtility.moveWindow(args.data);
case IPC_FUNCTIONS.RESET_SESSION:
Expand Down
Loading