[review, add time modal]

This commit is contained in:
romankko2 committed 2023-01-13 15:41:57 +01:00
1 parent 90cd75349c
commit 17a044b118
19 files changed
+228 -158

No files matched your search

@@ -1,8 +1,7 @@
<template>
<div>
<!-- Kravarik: Dat velke A -->
<a-project-filter :projects="projects" @filterChanged="onFilterChanged"></a-project-filter>
<a-project-calendar :events="filteredEvents" :month="filter.selectedMonth"></a-project-calendar>
<A-project-filter :projects="projects" @filterChanged="onFilterChanged" />
<A-project-calendar :events="filteredEvents" :month="filterSettings.selectedMonth" />
</div>
</template>
@@ -17,8 +16,7 @@ export default {
},
data() {
return {
// Kravarik: Toto premenuj na nejaky filterSettings alebo co to je
filter: {
filterSettings: {
selectedEmployee: null,
selectedMonth: new Date().getMonth(),
selectedProject: null,
@@ -33,22 +31,23 @@ export default {
}
},
async created() {
// Kravarik: Toto preco nieje v trycatch?
const events = await this.$axios.get_auth_data('v1/overview/projects')
// Kravarik: Nemusis nahodou z map returnovat? Ci ked {} obalis to () tak nemusis potom?
this.events = events.map((item) => ({
id: item.id,
title: `${item.project_code} - ${item.name}`,
title_html: `${item.project_code} - <b>${item.name}</b>`,
start: item.starts_at,
end: item.deadline,
is_finished: item.is_finished,
project_code: item.project_code,
backgroundColor: item.color,
borderColor: item.color
}))
try {
const events = await this.$axios.get_auth_data('v1/overview/projects')
this.events = events.map((item) => ({
id: item.id,
title: `${item.project_code} - ${item.name}`,
title_html: `${item.project_code} - <b>${item.name}</b>`,
start: item.starts_at,
end: item.deadline,
is_finished: item.is_finished,
project_code: item.project_code,
backgroundColor: item.color,
borderColor: item.color
}))
this.filteredEvents = this.events.filter((item) => !item.is_finished)
} catch (error) {
this.$toast.error(error)
}
},
methods: {
// Kravarik: TODO prepojit filtrovanie na BE