Skip to content

Commit

Permalink
Merge pull request #115 from yatt-ai/ok/new-dialogs
Browse files Browse the repository at this point in the history
Ok/new dialogs
  • Loading branch information
isntlazy authored Jan 16, 2024
2 parents 2d69e2b + 036818f commit 4d3a00c
Show file tree
Hide file tree
Showing 12 changed files with 1,654 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default {
const currentPath = this.$router.history.current.path;
if (state.path && currentPath !== state.path) {
if (state.path.includes("result") && this.$isElectron) {
// todo replace with dialog as soon dialog will be implemented
this.$electronService.setWindowSize({ width: 1440, height: 900 });
}
await this.$router.push({ path: state.path });
Expand Down
13 changes: 4 additions & 9 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1117,15 +1117,10 @@ export default {
this.changeSessionStatus(SESSION_STATUSES.START);
}
// creating new session ID here
let sessionId = null;
if (this.$store.state.id) {
sessionId = this.$store.state.id;
} else {
sessionId = uuidv4();
this.$store.commit("setSessionId", sessionId);
const sessionId = await this.$storageService.getSessionId();
if (sessionId === "") {
const data = {
id: sessionId,
title: this.$store.state.title,
charter: this.$store.state.charter,
preconditions: this.$store.state.preconditions,
Expand Down Expand Up @@ -1183,7 +1178,7 @@ export default {
if (this.$isElectron) {
this.$electronService.setWindowSize({ width: 1440, height: 900 });
}
this.$router.push({ path: "/result" }).catch(() => {});
await this.$router.push({ path: "/result" });
},
showSummaryDialog() {
if (this.viewMode === "normal") {
Expand Down
41 changes: 37 additions & 4 deletions src/components/TimelineWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,21 @@
</v-btn>
</v-col>
</v-row>
<AddEvidenceDialog
v-if="evidenceData"
v-model="addEvidenceDialog"
:item-data="evidenceData"
@close="addEvidenceDialog = false"
/>
<EditEvidenceDialog
v-if="itemToEdit"
v-model="editEvidenceDialog"
:item-data="itemToEdit"
@close="
editEvidenceDialog = false;
itemToEdit = null;
"
/>
</v-container>
</template>

Expand All @@ -949,11 +964,15 @@ import { VEmojiPicker } from "v-emoji-picker";
import dayjs from "dayjs";
import { STATUSES, TEXT_TYPES } from "../modules/constants";
import { STATUSES, TEXT_TYPES } from "@/modules/constants";
import AddEvidenceDialog from "@/components/dialogs/AddEvidenceDialog.vue";
import EditEvidenceDialog from "@/components/dialogs/EditEvidenceDialog.vue";
export default {
name: "TimelineWrapper",
components: {
EditEvidenceDialog,
AddEvidenceDialog,
VContainer,
VRow,
VCol,
Expand Down Expand Up @@ -998,6 +1017,7 @@ export default {
itemLists: this.items,
selected: [],
activeSession: {},
itemToEdit: null,
tags: "",
eventName: this.eventType,
textTypes: TEXT_TYPES,
Expand All @@ -1006,6 +1026,9 @@ export default {
itemDragging: false,
emojiMenu: {},
selectedId: null,
addEvidenceDialog: false,
evidenceData: null,
editEvidenceDialog: false,
};
},
computed: {
Expand Down Expand Up @@ -1038,6 +1061,7 @@ export default {
return hours + ":" + minutes + ":" + seconds;
},
async uploadEvidence() {
console.log("upload evidence");
// todo add relative handler for web app
if (this.$isElectron) {
const { status, message, item } =
Expand All @@ -1054,7 +1078,9 @@ export default {
filePath: item.filePath,
timer_mark: this.$store.state.timer,
};
await this.openEditorModal(data);
// await this.openEditorModal(data);
this.evidenceData = data;
this.addEvidenceDialog = true;
}
}
},
Expand All @@ -1080,6 +1106,7 @@ export default {
if (this.clicks === 1) {
setTimeout(
function () {
console.log("trigger from here");
switch (this.clicks) {
case 1:
if (this.eventName === "click") {
Expand Down Expand Up @@ -1108,8 +1135,13 @@ export default {
this.saveData();
},
async handleActiveSession(id) {
this.activeSession = await this.$storageService.getItemById(id);
this.$emit("submit-session", this.activeSession);
console.log("handleActiveSession", { id });
this.itemToEdit = await this.$storageService.getItemById(id);
console.log("item to edit", this.itemToEdit);
this.editEvidenceDialog = true;
// this.activeSession = await this.$storageService.getItemById(id);
// this.$emit("submit-session", this.activeSession);
},
async dragItem(event, item) {
event.preventDefault();
Expand All @@ -1121,6 +1153,7 @@ export default {
}
},
async dropFile(event) {
console.log("Drop file");
event.preventDefault();
event.stopPropagation();
this.isDragging = false;
Expand Down
Loading

0 comments on commit 4d3a00c

Please sign in to comment.