no message

This commit is contained in:
StudioTem committed 2026-01-17 13:49:05 +00:00
1 parent 399f80e106
commit 3016b6aaa0
5 files changed
+41 -15

No files matched your search

@@ -209,15 +209,17 @@ export default {
if (this.$route.name == 'Dashboard - Tasks') { if (this.$route.name == 'Dashboard - Tasks') {
const editedSubtask = { const editedSubtask = {
...event.subtask, ...event.subtask,
timeblocks: [ timeblocks: event.subtask.timeblocks.map((tb) => {
...event.subtask.timeblocks, if (tb.id === event._timeblock_id) {
{ return {
id: event._timeblock_id, id: event._timeblock_id,
is_finished: 0, is_finished: tb.is_finished || 0,
start: tmUtils.formatDateTimeForBackend(start), start: tmUtils.formatDateTimeForBackend(start),
end: tmUtils.formatDateTimeForBackend(end), end: tmUtils.formatDateTimeForBackend(end),
}, };
], }
return tb;
}),
timesheets: event.subtask.timesheets.map((timesheet) => { timesheets: event.subtask.timesheets.map((timesheet) => {
delete timesheet.employee_name; delete timesheet.employee_name;
return timesheet; return timesheet;
@@ -245,15 +247,17 @@ export default {
const editedSubtask = { const editedSubtask = {
...event.subtask, ...event.subtask,
employee_id: split.employee_id, employee_id: split.employee_id,
timeblocks: [ timeblocks: event.subtask.timeblocks.map((tb) => {
...event.subtask.timeblocks, if (tb.id === event._timeblock_id) {
{ return {
id: event._timeblock_id, id: event._timeblock_id,
is_finished: 0, is_finished: tb.is_finished || 0,
start: tmUtils.formatDateTimeForBackend(event.start), start: tmUtils.formatDateTimeForBackend(event.start),
end: tmUtils.formatDateTimeForBackend(event.end), end: tmUtils.formatDateTimeForBackend(event.end),
}, };
], }
return tb;
}),
timesheets: event.subtask.timesheets.map((timesheet) => { timesheets: event.subtask.timesheets.map((timesheet) => {
delete timesheet.employee_name; delete timesheet.employee_name;
return timesheet; return timesheet;
+10 -3
View File
@@ -628,7 +628,9 @@ export default {
// Helper: Get timeblocks for specific employee // Helper: Get timeblocks for specific employee
getEmployeeTimeblocks(employeeId) { getEmployeeTimeblocks(employeeId) {
if (!this.timeblocks) return []; if (!this.timeblocks) return [];
return this.timeblocks.filter((tb) => tb.employee_id == employeeId); return this.timeblocks.filter(
(tb) => Number(tb.employee_id) === Number(employeeId),
);
}, },
updateEmployeeTimeblocks(updatedTimeblocks, employeeId) { updateEmployeeTimeblocks(updatedTimeblocks, employeeId) {
@@ -1040,13 +1042,18 @@ export default {
// Convert timeblocks from internal format to BE format for update // Convert timeblocks from internal format to BE format for update
// Filter out completely empty timeblocks AND timeblocks without all required fields // Filter out completely empty timeblocks AND timeblocks without all required fields
const timeblocks = this.timeblocks // Pre draft s multiple employees preskočiť - timeblocks sú v employees array
const timeblocks =
this.subtask.is_draft && this.isDraftWithMultipleEmployees
? []
: this.timeblocks
.filter( .filter(
(timeblock) => (timeblock) =>
timeblock.date && timeblock.date &&
timeblock.starts_at_time && timeblock.starts_at_time &&
timeblock.ends_at_time && timeblock.ends_at_time &&
timeblock.employee_id == this.subtask.employee_id, Number(timeblock.employee_id) ===
Number(this.subtask.employee_id),
) // Only send complete timeblocks for this employee ) // Only send complete timeblocks for this employee
.map((timeblock) => { .map((timeblock) => {
const dateStr = moment(timeblock.date).format('YYYY-MM-DD'); const dateStr = moment(timeblock.date).format('YYYY-MM-DD');
@@ -27,6 +27,11 @@ class SendDeletedSubTaskNotification
*/ */
public function handle(SubTaskDeleted $event) public function handle(SubTaskDeleted $event)
{ {
// Neposielame notifikacie pri mazani konceptov (draftov)
if ($event->subtask->is_draft) {
return;
}
$receiversArray[] = $event->subtask->user->email; $receiversArray[] = $event->subtask->user->email;
$creator = \App\Models\User::find($event->subtask->created_by); $creator = \App\Models\User::find($event->subtask->created_by);
@@ -31,6 +31,11 @@ class SendEditedSubTaskNotification implements ShouldQueue
*/ */
public function handle(SubTaskEdited $event) public function handle(SubTaskEdited $event)
{ {
// Neposielame notifikacie pre koncepty (drafty)
if ($event->subtask->is_draft) {
return;
}
// emailova notifikacia sa posiela len ak subtask bol upraveny inym uzivatelom // emailova notifikacia sa posiela len ak subtask bol upraveny inym uzivatelom
if ($event->subtask->updated_by == $event->subtask->user_id) { if ($event->subtask->updated_by == $event->subtask->user_id) {
return; return;
@@ -31,6 +31,11 @@ class SendNewSubTaskEmailNotification implements ShouldQueue
*/ */
public function handle(SubTaskCreated $event) public function handle(SubTaskCreated $event)
{ {
// Neposielame notifikacie pre koncepty (drafty)
if ($event->subtask->is_draft) {
return;
}
// flag na urovni subtasku - notification_sent // flag na urovni subtasku - notification_sent
// ak existuje este nejaky subtask v ramci master tasku, co ma prazdnu notification_sent, tak mu nastavim 0 a skippujem posielanie emailu // ak existuje este nejaky subtask v ramci master tasku, co ma prazdnu notification_sent, tak mu nastavim 0 a skippujem posielanie emailu
// az ked neexistuje uz iny subtask, co ma flag prazdny, tak poslem email a nastavim notification_sent na 1 // az ked neexistuje uz iny subtask, co ma flag prazdny, tak poslem email a nastavim notification_sent na 1