This commit is contained in:
Matej Glasnák committed 2023-01-12 14:45:18 +01:00
1 parent 79f563a82d
commit d46a9151fc
27 files changed
+279 -339

No files matched your search

@@ -2,7 +2,7 @@
<div>
<Z-tasks-search @queryChange="filterOngoingTasks" />
<W-loadable :content="ongoingTasks">
<A-ongoing-table :tasks="filteredOngoingTasks" />
<h6
@@ -12,7 +12,7 @@
Aktuálnemu hľadaniu nevyhovujú žiadne prebiehajúce úlohy
</h6>
</W-loadable>
</div>
</template>
@@ -38,19 +38,22 @@ export default {
this.ongoingTasks = await this.$axios.get_auth_data('v1/overview/ongoing-tasks')
this.filterOngoingTasks()
} catch (error) {
// Kravarik: ked to je takto ze idu data do w-loadable tak musis dat this.ongoingTasks = {error}
// Ten toast vyhod a to kde nastavujes error musis dat do {} ako v riadku hore lebo ono to pozera if (content.error)
this.ongoingTasks = error
this.$toast.error(error)
}
},
methods: {
// Kravarik: Toto sprav cez computed. A bude tam ze if (!searchQuerry) return this.ongoing tasks. Else to prefiltrujes
filterOngoingTasks(searchQuery) {
if(!searchQuery) return this.filteredOngoingTasks = this.ongoingTasks
this.filteredOngoingTasks = this.ongoingTasks.filter((task) => {
return this.filterParams(searchQuery, task.title) || this.filterParams(searchQuery, task.project_code)
})
},
filterParams(searchQuery, row) {
return row.toLowerCase().includes(searchQuery.toLowerCase())
}