diff --git a/server.js b/server.js index aa803bc..6968b29 100644 --- a/server.js +++ b/server.js @@ -642,7 +642,6 @@ export function clientsServer() { }, ], }, - { id: "2faa5ff2-2de6-422c-a401-1b35cd455223", start: "2022-10-25T17:10:00Z", @@ -686,6 +685,49 @@ export function clientsServer() { }, ], }, + { + id: "2faa5ff2-2de6-422c-a401-1b35cd455223", + start: "2022-10-26T20:10:00Z", + end: "2022-10-26T21:00:00Z", + kind: "call", + subkind: null, + description: "", + location: null, + members: [ + { + id: "a9239f9a-e824-4bb3-a260-2b32dae9bc76", + person: { + id: "15ff465c-2b7b-4d9a-9159-720c74d8b56d", + last_name: "Елесеевская", + first_name: "Татьяна", + patronymic: "Ивановна", + }, + role: null, + }, + ], + employees: [ + { + id: "f941a0c6-c734-4f79-92c2-d7a5674459e422", + employee: { + id: "db831a15-e876-481f-a658-6325de7c311e", + last_name: "Константинопольская", + first_name: "Юлия", + patronymic: "Викторовна", + }, + role: null, + }, + { + id: "f541a0c7-c750-4f79-92c0-d7a19354e422", + employee: { + id: "db938a67-e756-481f-a653-6325de7c567e", + last_name: "Коломойцев", + first_name: "Илья", + patronymic: "Константинович", + }, + role: "owner", + }, + ], + }, ], })); this.passthrough("http://45.84.227.122:8080/**"); diff --git a/src/pages/calendar/components/CalendarBackground.vue b/src/pages/calendar/components/CalendarBackground.vue index 8417ee5..9b036ce 100644 --- a/src/pages/calendar/components/CalendarBackground.vue +++ b/src/pages/calendar/components/CalendarBackground.vue @@ -32,6 +32,7 @@ export default { components: { CalendarColumn }, props: { timeCoil: Array, + filteredOwners: Array, eventsData: Array, currentDate: Object, sidebarWidth: String, @@ -63,48 +64,17 @@ export default { backgroundHeight() { return (this.timeCoil.length - 1) * this.pixelsPerHour + 48; }, - horizontalScrollPresence() { - return { - "scroll-x": this.ownersArrayLength > 3 && this.backgroundHeight < 855, - }; - }, - filteredOwners() { - let filteredArray = []; - let ownerAbsence = { - id: null, - last_name: null, - first_name: null, - patronymic: null, - }; - this.eventsData.forEach(({ employees }) => { - let findedElement = employees.find((elem) => elem.role === "owner"); - let emptyDataPresence = this.findObjectInArray( - filteredArray, - ownerAbsence - ); - if (!findedElement && !emptyDataPresence) { - filteredArray.push(ownerAbsence); - } - if (findedElement) { - let ownerPresence = this.findObjectInArray( - filteredArray, - findedElement.employee - ); - if (!ownerPresence) { - filteredArray.push(findedElement.employee); - } - } - }); - return filteredArray.sort( - (previous, subsequent) => Boolean(subsequent.id) - Boolean(previous.id) - ); - }, filteredEventsByDate() { return this.eventsData.filter( ({ start }) => start.slice(0, 10) === this.currentDate.format("YYYY-MM-DD") ); }, + horizontalScrollPresence() { + return { + "scroll-x": this.ownersArrayLength > 3, + }; + }, }, methods: { calculateColumnPosition(elemIndex) { @@ -125,12 +95,7 @@ export default { }; }, calculateBackgroundWidth() { - this.backgroundWidth = this.$refs.backgroundWrapper.offsetWidth; - }, - findObjectInArray(array, object) { - return array.find( - (item) => JSON.stringify(item) === JSON.stringify(object) - ); + this.backgroundWidth = this.$refs.backgroundWrapper.scrollWidth; }, filterEventsByOwner(owner) { let filteredArray = []; @@ -153,8 +118,7 @@ export default {