Bläddra i källkod

remove "copie de"

tripeur 4 år sedan
förälder
incheckning
83d1fec285
5 ändrade filer med 30 tillägg och 10 borttagningar
  1. 4 4
      package-lock.json
  2. 1 1
      package.json
  3. 1 1
      src/components/Utils/Footer.vue
  4. 1 2
      src/mixins/ImportJsonState.ts
  5. 23 2
      src/views/Planning.vue

+ 4 - 4
package-lock.json

@@ -1,11 +1,11 @@
 {
   "name": "bdlg-scheduler",
-  "version": "1.3.1",
+  "version": "1.3.5",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
-      "version": "1.3.1",
+      "version": "1.3.5",
       "dependencies": {
         "dayjs": "^1.10.4",
         "fuse.js": "^6.4.6",
@@ -10362,7 +10362,7 @@
     },
     "node_modules/jc-timeline": {
       "version": "0.2.11",
-      "resolved": "git+http://gitlab.jaquin.fr/clovis/jc-timeline.git#e4207956fdb15b2050a2b1d5379d3c99c8cfbe0c",
+      "resolved": "git+http://gitlab.jaquin.fr/clovis/jc-timeline.git#25498b11e4235e9b74cae8f0826521bde90de5af",
       "license": "ISC",
       "dependencies": {
         "dayjs": "^1.10.4",
@@ -30560,7 +30560,7 @@
       "dev": true
     },
     "jc-timeline": {
-      "version": "git+http://gitlab.jaquin.fr/clovis/jc-timeline.git#e4207956fdb15b2050a2b1d5379d3c99c8cfbe0c",
+      "version": "git+http://gitlab.jaquin.fr/clovis/jc-timeline.git#25498b11e4235e9b74cae8f0826521bde90de5af",
       "from": "jc-timeline@git+http://gitlab.jaquin.fr/clovis/jc-timeline.git",
       "requires": {
         "dayjs": "^1.10.4",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "bdlg-scheduler",
-  "version": "1.3.4",
+  "version": "1.3.5",
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve --port 8081",

+ 1 - 1
src/components/Utils/Footer.vue

@@ -2,7 +2,7 @@
   <footer class="footer">
     <a :href="logout" v-if="connected">Se déconnecter</a>
     <a :href="adminPage" v-if="isAdmin">Admninistration</a>
-    <span>© 2021 - {{ year }} par Clovis Jaquin 1.3.4</span>
+    <span>© 2021 - {{ year }} par Clovis Jaquin 1.3.5</span>
   </footer>
 </template>
 

+ 1 - 2
src/mixins/ImportJsonState.ts

@@ -2,8 +2,7 @@ import Benevole from "@/models/Benevole";
 import Competence from "@/models/Competence";
 import Creneau from "@/models/Creneau";
 import Evenement from "@/models/Evenement";
-import { ActionTypes } from "@/store/Actions";
-import { Mutations, MutationTypes } from "@/store/Mutations";
+import { MutationTypes } from "@/store/Mutations";
 import { EvenementStateJSON } from "@/store/State";
 import { Ressource } from "jc-timeline";
 import { defineComponent } from "vue";

+ 23 - 2
src/views/Planning.vue

@@ -179,7 +179,7 @@ export default defineComponent({
         ...payload.toJSON(),
         event: new jcEvent({ ...payload.event, id: uuidv4() }),
       });
-      newCreneau.title = "Copie de " + newCreneau.title;
+      // newCreneau.title = "Copie de " + newCreneau.title;
       this.timeline.addEvent(newCreneau.event);
       this.commit(MutationTypes.addCreneau, newCreneau);
       this.currentCreneau = newCreneau;
@@ -304,6 +304,25 @@ export default defineComponent({
       this.menuY = e.clientY;
       (this.$refs.menu as typeof ContextMenu).open();
     },
+    dblclick(e: MouseEvent) {
+      if (this.timeline) {
+        const node = this.timeline.shadowRoot?.elementFromPoint(e.clientX, e.clientY);
+        if (node) {
+          if (node.className.startsWith("jc-timeslot-") || node.classList.contains("jc-timeslot")) {
+            const timeslot = node.classList.contains("jc-timeslot") ? node : node.parentElement;
+            const creneau = this.$store.getters.getCreneauById(
+              timeslot?.getAttribute("eventid") ?? ""
+            );
+            if (creneau) {
+              this.currentCreneau = creneau;
+              setTimeout(() => {
+                (document.getElementById("last_name") as HTMLInputElement | undefined)?.select();
+              }, 100);
+            }
+          }
+        }
+      }
+    },
     rightclick(e: MouseEvent) {
       if (this.timeline) {
         const node = this.timeline.shadowRoot?.elementFromPoint(e.clientX, e.clientY);
@@ -393,7 +412,7 @@ export default defineComponent({
   mounted() {
     this.timeline.setAttribute("start", this.start.toISOString());
     this.timeline.setAttribute("end", this.end.toISOString());
-    this.timeline.addRessources(this.creneauGroupList);
+    this.timeline.addRessources(this.creneauGroupList, 0);
     this.$store.commit(
       MutationTypes.reorderCreneauGroup,
       this.timeline.getRessources().map((o) => o.id)
@@ -430,6 +449,8 @@ export default defineComponent({
 }`;
     this.timeline.clearSelectedItems();
     this.timeline.addEventListener("contextmenu", this.rightclick);
+
+    this.timeline.addEventListener("dblclick", this.dblclick);
   },
 });
 </script>