@@ -394,7 +433,6 @@ import {
VTimelineItem,
VBtn,
} from "vuetify/lib/components";
-import Draggable from "vuedraggable";
import dayjs from "dayjs";
import { IPC_HANDLERS, IPC_FUNCTIONS, STATUSES } from "../modules/constants";
@@ -409,7 +447,6 @@ export default {
VTimeline,
VTimelineItem,
VBtn,
- Draggable,
},
props: {
items: {
@@ -445,6 +482,7 @@ export default {
eventName: this.eventType,
clicks: 0,
isDragging: false,
+ itemDragging: false,
};
},
computed: {
@@ -551,46 +589,51 @@ export default {
},
dragItem(event, item) {
event.preventDefault();
-
+ this.itemDragging = true;
if (!window.ipc) return;
- console.log(item);
- window.ipc.invoke(IPC_HANDLERS.FILE_SYSTEM, {
- func: IPC_FUNCTIONS.DRAG_ITEM,
- data: item,
- });
+ window.ipc
+ .invoke(IPC_HANDLERS.FILE_SYSTEM, {
+ func: IPC_FUNCTIONS.DRAG_ITEM,
+ data: item,
+ })
+ .then(() => {
+ this.itemDragging = false;
+ });
},
async dropFile(event) {
event.preventDefault();
event.stopPropagation();
+ this.isDragging = false;
+ if (!this.itemDragging) {
+ if (event.dataTransfer.files.length === 0 || !window.ipc) {
+ return;
+ }
- if (event.dataTransfer.files.length === 0 || !window.ipc) {
- return;
- }
+ const f = event.dataTransfer.files[0];
+ const { status, error, result } = await window.ipc.invoke(
+ IPC_HANDLERS.CAPTURE,
+ {
+ func: IPC_FUNCTIONS.DROP_FILE,
+ data: {
+ path: f.path,
+ name: f.name,
+ },
+ }
+ );
- const f = event.dataTransfer.files[0];
- const { status, error, result } = await window.ipc.invoke(
- IPC_HANDLERS.CAPTURE,
- {
- func: IPC_FUNCTIONS.DROP_FILE,
- data: {
- path: f.path,
- name: f.name,
- },
+ if (status === STATUSES.ERROR) {
+ console.log(error);
+ } else {
+ const data = {
+ sessionType: "File",
+ fileType: result.fileType,
+ fileName: result.fileName,
+ filePath: result.filePath,
+ time: this.$store.state.timer,
+ };
+ this.openEditorModal(data);
+ this.isDragging = false;
}
- );
-
- if (status === STATUSES.ERROR) {
- console.log(error);
- } else {
- const data = {
- sessionType: "File",
- fileType: result.fileType,
- fileName: result.fileName,
- filePath: result.filePath,
- time: this.$store.state.timer,
- };
- this.openEditorModal(data);
- this.isDragging = false;
}
},
dragEnter(event) {
diff --git a/src/components/__tests__/ControlPanel.spec.js b/src/components/__tests__/ControlPanel.spec.js
index 8618688b..0a45937d 100644
--- a/src/components/__tests__/ControlPanel.spec.js
+++ b/src/components/__tests__/ControlPanel.spec.js
@@ -35,7 +35,7 @@ describe("ControlPanel.vue", () => {
store = new Vuex.Store(cloneDeep(storeConfig));
});
- test('displays "Start New Session" button', () => {
+ test('displays "Start Session" button', () => {
const wrapper = mount(ControlPanel, {
mocks: {
$t: () => {},
diff --git a/src/components/__tests__/TextEditor.spec.js b/src/components/__tests__/TextEditor.spec.js
deleted file mode 100644
index dc84bc5d..00000000
--- a/src/components/__tests__/TextEditor.spec.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import { mount } from "@vue/test-utils";
-
-import TextEditor from "../TextEditor";
-
-describe("TextEditor.vue", () => {
- const dataInfo = {
- apiKey: "gsamuimia341odbjm3dbaxstm3a8ttjg458ce840htiimyk5",
- config: {
- selector: "textarea",
- plugins: [
- "lists",
- "advlist",
- "image",
- "link",
- "code",
- "table",
- "emoticons",
- ],
- toolbar:
- "block | bold italic formatgroup | forecolor | bullist | link emoticons insertgroup",
- block_formats: "Paragraph=p;Header 1=h1;Header 2=h2;Header 3=h3",
- font_formats:
- "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n",
- toolbar_groups: {
- formatgroup: {
- icon: "more-drawer",
- tooltip: "More rormatting",
- items:
- "underline strikethrough | superscript subscript | code removeformat",
- },
-
- insertgroup: {
- icon: "plus",
- tooltip: "Insert",
- items: "code blockquote table hr",
- },
- },
- menubar: false,
- statusbar: false,
- },
- };
-
- test("displays label text", () => {
- const wrapper = mount(TextEditor, {
- mocks: {
- $t: () => {},
- $tc: () => {},
- },
- propsData: {
- label: "subtitle",
- placeholder: "",
- content: "",
- height: 100,
- },
- data() {
- return dataInfo;
- },
- });
-
- expect(wrapper.find(".subtitle-2.label-text")).toBeTruthy();
- expect(wrapper.find(".subtitle-2.label-text").text()).toBe("subtitle");
- });
-});
diff --git a/src/components/dialogs/NoteDialog.vue b/src/components/dialogs/NoteDialog.vue
index c5bfce5f..04857f8f 100644
--- a/src/components/dialogs/NoteDialog.vue
+++ b/src/components/dialogs/NoteDialog.vue
@@ -39,7 +39,7 @@